9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

减少不必要的破坏状态包

This commit is contained in:
XiaoMoMi
2025-06-09 02:44:07 +08:00
parent cad960a8b9
commit 22d2b7716e
2 changed files with 11 additions and 5 deletions

View File

@@ -535,8 +535,10 @@ public class BukkitServerPlayer extends Player {
public void abortMiningBlock() {
this.swingHandAck = false;
this.miningProgress = 0;
if (this.destroyPos != null) {
this.broadcastDestroyProgress(platformPlayer(), this.destroyPos, LocationUtils.toBlockPos(this.destroyPos), -1);
BlockPos pos = this.destroyPos;
if (pos != null && this.isDestroyingCustomBlock) {
// 只纠正自定义方块的
this.broadcastDestroyProgress(platformPlayer(), pos, LocationUtils.toBlockPos(pos), -1);
}
}
@@ -701,16 +703,20 @@ public class BukkitServerPlayer extends Player {
public void setIsDestroyingBlock(boolean is, boolean custom) {
this.miningProgress = 0;
this.isDestroyingBlock = is;
this.isDestroyingCustomBlock = custom && is;
if (is) {
this.swingHandAck = true;
this.isDestroyingCustomBlock = custom;
} else {
this.swingHandAck = false;
this.destroyedState = null;
if (this.destroyPos != null) {
this.broadcastDestroyProgress(platformPlayer(), this.destroyPos, LocationUtils.toBlockPos(this.destroyPos), -1);
// 只纠正自定义方块的
if (this.isDestroyingCustomBlock) {
this.broadcastDestroyProgress(platformPlayer(), this.destroyPos, LocationUtils.toBlockPos(this.destroyPos), -1);
}
this.destroyPos = null;
}
this.isDestroyingCustomBlock = false;
}
}

View File

@@ -51,7 +51,7 @@ byte_buddy_version=1.17.5
ahocorasick_version=0.6.3
snake_yaml_version=2.4
anti_grief_version=0.17
nms_helper_version=0.66.17
nms_helper_version=0.67.1
evalex_version=3.5.0
reactive_streams_version=1.0.4
amazon_awssdk_version=2.31.23