9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-06 15:52:03 +00:00

修复tick破坏掉落物

This commit is contained in:
XiaoMoMi
2025-06-28 03:38:26 +08:00
parent 7da8d75dad
commit 72238b376b
2 changed files with 2 additions and 3 deletions

View File

@@ -32,11 +32,10 @@ public abstract class AbstractCanSurviveBlockBehavior extends BukkitBlockBehavio
if (!canSurvive(thisBlock, args, () -> true)) {
BlockStateUtils.getOptionalCustomBlockState(blockState).ifPresent(customState -> {
if (!customState.isEmpty() && customState.owner().value() == this.customBlock) {
FastNMS.INSTANCE.method$Level$removeBlock(level, blockPos, false);
net.momirealms.craftengine.core.world.World world = new BukkitWorld(FastNMS.INSTANCE.method$Level$getCraftWorld(level));
WorldPosition position = new WorldPosition(world, Vec3d.atCenterOf(LocationUtils.fromBlockPos(blockPos)));
world.playBlockSound(position, customState.sounds().breakSound());
FastNMS.INSTANCE.method$Level$levelEvent(level, WorldEvents.BLOCK_BREAK_EFFECT, blockPos, customState.customBlockState().registryId());
FastNMS.INSTANCE.method$Level$destroyBlock(level, blockPos, true);
}
});
}

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=1.0.13
nms_helper_version=1.0.14
evalex_version=3.5.0
reactive_streams_version=1.0.4
amazon_awssdk_version=2.31.23