From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Sun, 3 Apr 2022 11:31:04 +0800 Subject: [PATCH] Budding Amethyst can push by piston diff --git a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java index bedccb8717d08d5a60058445b04ddff149e7d36c..2b452ae8d26107973f503451164f65dea42e42c0 100644 --- a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java @@ -20,6 +20,11 @@ public class BuddingAmethystBlock extends AmethystBlock { @Override public PushReaction getPistonPushReaction(BlockState state) { + // Leaves start - budding amethyst can push by piston + if (top.leavesmc.leaves.LeavesConfig.buddingAmethystCanPushByPiston) { + return PushReaction.PUSH_ONLY; + } + // Leaves end - budding amethyst can push by piston return PushReaction.DESTROY; } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java index 9517e2afa18256f6f1c7e8b670ee9012fa55ecf6..590db5dac5c78992170003498ec83b5ee531d760 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -106,12 +106,14 @@ public final class LeavesConfig { unableFakeplayerNames = (List) config.getList("settings.fakeplayer.unable-fakeplayer-names", unableFakeplayerNames); shearsInDispenserCanZeroAmount = config.getBoolean("settings.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount); redstoneShearsWrench = config.getBoolean("settings.redstone-shears-wrench", redstoneShearsWrench); + buddingAmethystCanPushByPiston = config.getBoolean("settings.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston); config.set("settings.snowball-and-egg-can-knockback-player", null); config.set("settings.player-can-edit-sign", null); config.set("settings.fakeplayer", null); config.set("settings.shears-in-dispenser-can-zero-amount", null); config.set("settings.redstone-shears-wrench", null); + config.set("settings.budding-amethyst-can-push-by-piston", null); } } @@ -189,6 +191,11 @@ public final class LeavesConfig { redstoneShearsWrench = getBoolean("settings.modify.redstone-shears-wrench", redstoneShearsWrench); } + public static boolean buddingAmethystCanPushByPiston = false; + private static void buddingAmethystCanPushByPiston() { + buddingAmethystCanPushByPiston = getBoolean("settings.modify.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston); + } + public static final class WorldConfig { public final String worldName;