Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
34 lines
1.8 KiB
Diff
34 lines
1.8 KiB
Diff
--- a/net/minecraft/world/item/ShovelItem.java
|
|
+++ b/net/minecraft/world/item/ShovelItem.java
|
|
@@ -45,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, 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) {
|