diff --git a/patches/server/0162-Config-for-changing-the-blocks-that-turn-into-dirt-p.patch b/patches/server/0162-Config-for-changing-the-blocks-that-turn-into-dirt-p.patch index c68752f6d..7a724c0af 100644 --- a/patches/server/0162-Config-for-changing-the-blocks-that-turn-into-dirt-p.patch +++ b/patches/server/0162-Config-for-changing-the-blocks-that-turn-into-dirt-p.patch @@ -5,18 +5,53 @@ Subject: [PATCH] Config for changing the blocks that turn into dirt paths diff --git a/src/main/java/net/minecraft/world/item/ShovelItem.java b/src/main/java/net/minecraft/world/item/ShovelItem.java -index c7195f2e12bbd6545f7bffcc2b4ba5cc3d48df20..5e730bc9c8ff94b16ac2bf8567dda8aea2ee4b2a 100644 +index 21212462e6b415e96536a27b2c009d1562f18946..98f4870ab82b25ed8bb144835f74c581ad9b9134 100644 --- a/src/main/java/net/minecraft/world/item/ShovelItem.java +++ b/src/main/java/net/minecraft/world/item/ShovelItem.java -@@ -34,7 +34,7 @@ public class ShovelItem extends DiggerItem { +@@ -34,13 +34,20 @@ public class ShovelItem extends DiggerItem { return InteractionResult.PASS; } else { Player player = context.getPlayer(); - BlockState blockState2 = FLATTENABLES.get(blockState.getBlock()); -+ BlockState blockState2 = level.purpurConfig.shovelTurnsBlockToGrassPath.contains(blockState.getBlock()) ? Blocks.DIRT_PATH.defaultBlockState() : null; // Purpur ++ // Purpur start ++ BlockState blockState2 = level.purpurConfig.shovelTurnsBlockToGrassPath.contains(blockState.getBlock()) ? Blocks.DIRT_PATH.defaultBlockState() : null; ++ boolean isUniqueFlattenable; ++ // Purpur end BlockState blockState3 = null; Runnable afterAction = null; // Paper if (blockState2 != null && level.getBlockState(blockPos.above()).isAir()) { +- afterAction = () -> level.playSound(player, blockPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); // Paper ++ // Purpur start ++ isUniqueFlattenable = FLATTENABLES.get(blockState.getBlock()) == null; ++ afterAction = () -> level.playSound(isUniqueFlattenable ? null : player, blockPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); // Paper ++ // Purpur end + blockState3 = blockState2; + } else if (blockState.getBlock() instanceof CampfireBlock && blockState.getValue(CampfireBlock.LIT)) { ++ isUniqueFlattenable = false; // Purpur + afterAction = () -> { // Paper + if (!level.isClientSide()) { + level.levelEvent((Player)null, 1009, blockPos, 0); +@@ -50,6 +57,11 @@ public class ShovelItem extends DiggerItem { + }; // Paper + blockState3 = blockState.setValue(CampfireBlock.LIT, Boolean.valueOf(false)); + } ++ // Purpur start ++ else { ++ isUniqueFlattenable = false; ++ } ++ // Purpur end + + if (blockState3 != null) { + if (!level.isClientSide) { +@@ -68,7 +80,7 @@ public class ShovelItem extends DiggerItem { + } + } + +- return InteractionResult.sidedSuccess(level.isClientSide); ++ return isUniqueFlattenable ? InteractionResult.SUCCESS : InteractionResult.sidedSuccess(level.isClientSide); // Purpur + } else { + return InteractionResult.PASS; + } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index c8596997a2d0ef53ca028373da8ddad321fb44c5..6c6de8b218bc0ebb183d6a63fc3dee6b777af03a 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java