--- a/net/minecraft/world/item/ShovelItem.java +++ b/net/minecraft/world/item/ShovelItem.java @@ -46,20 +_,29 @@ Player player = context.getPlayer(); BlockState blockState1 = FLATTENABLES.get(blockState.getBlock()); BlockState blockState2 = null; + Runnable afterAction = null; // Paper if (blockState1 != null && level.getBlockState(clickedPos.above()).isAir()) { - level.playSound(player, clickedPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); + afterAction = () -> level.playSound(player, clickedPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); // Paper blockState2 = blockState1; } else if (blockState.getBlock() instanceof CampfireBlock && blockState.getValue(CampfireBlock.LIT)) { + afterAction = () -> { // Paper if (!level.isClientSide()) { level.levelEvent(null, 1009, clickedPos, 0); } CampfireBlock.dowse(context.getPlayer(), level, clickedPos, blockState); + }; // Paper blockState2 = blockState.setValue(CampfireBlock.LIT, Boolean.valueOf(false)); } if (blockState2 != null) { if (!level.isClientSide) { + // Paper start + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(context.getPlayer(), clickedPos, blockState2)) { + return InteractionResult.PASS; + } + afterAction.run(); + // Paper end level.setBlock(clickedPos, blockState2, 11); level.gameEvent(GameEvent.BLOCK_CHANGE, clickedPos, GameEvent.Context.of(player, blockState2)); if (player != null) {