9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-20 15:39:22 +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() { public void abortMiningBlock() {
this.swingHandAck = false; this.swingHandAck = false;
this.miningProgress = 0; this.miningProgress = 0;
if (this.destroyPos != null) { BlockPos pos = this.destroyPos;
this.broadcastDestroyProgress(platformPlayer(), this.destroyPos, LocationUtils.toBlockPos(this.destroyPos), -1); 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) { public void setIsDestroyingBlock(boolean is, boolean custom) {
this.miningProgress = 0; this.miningProgress = 0;
this.isDestroyingBlock = is; this.isDestroyingBlock = is;
this.isDestroyingCustomBlock = custom && is;
if (is) { if (is) {
this.swingHandAck = true; this.swingHandAck = true;
this.isDestroyingCustomBlock = custom;
} else { } else {
this.swingHandAck = false; this.swingHandAck = false;
this.destroyedState = null; this.destroyedState = null;
if (this.destroyPos != null) { if (this.destroyPos != null) {
// 只纠正自定义方块的
if (this.isDestroyingCustomBlock) {
this.broadcastDestroyProgress(platformPlayer(), this.destroyPos, LocationUtils.toBlockPos(this.destroyPos), -1); this.broadcastDestroyProgress(platformPlayer(), this.destroyPos, LocationUtils.toBlockPos(this.destroyPos), -1);
}
this.destroyPos = null; this.destroyPos = null;
} }
this.isDestroyingCustomBlock = false;
} }
} }

View File

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