mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-30 12:29:15 +00:00
修复tick破坏掉落物
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user