mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 01:49:30 +00:00
修复潜在NPE,优化秒破粒子
This commit is contained in:
@@ -371,11 +371,16 @@ public class BukkitServerPlayer extends Player {
|
||||
// if it's not an instant break on client side, we should resend level event
|
||||
if (vanillaBlockState != null && getDestroyProgress(vanillaBlockState.handle(), pos) < 1f) {
|
||||
Object levelEventPacket = FastNMS.INSTANCE.constructor$ClientboundLevelEventPacket(
|
||||
WorldEvents.BLOCK_BREAK_EFFECT, LocationUtils.toBlockPos(pos), BlockStateUtils.blockStateToId(this.destroyedState), false);
|
||||
WorldEvents.BLOCK_BREAK_EFFECT, LocationUtils.toBlockPos(pos), BlockStateUtils.blockStateToId(state), false);
|
||||
sendPacket(levelEventPacket, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!custom && !this.clientSideCanBreak && getDestroyProgress(state, pos) >= 1f) {
|
||||
Object levelEventPacket = FastNMS.INSTANCE.constructor$ClientboundLevelEventPacket(
|
||||
WorldEvents.BLOCK_BREAK_EFFECT, LocationUtils.toBlockPos(pos), BlockStateUtils.blockStateToId(state), false);
|
||||
sendPacket(levelEventPacket, false);
|
||||
}
|
||||
// if it's a custom one, we prevent it, otherwise we allow it
|
||||
setClientSideCanBreakBlock(!custom);
|
||||
// set some base info
|
||||
|
||||
Reference in New Issue
Block a user