9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-22 08:29:22 +00:00
Files
LeavesMC/patches/server/0013-Budding-Amethyst-can-push-by-piston.patch
2022-08-17 10:31:39 +08:00

54 lines
2.9 KiB
Diff

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 f0c9913333c055993257756ead252ec4dc6914fa..4b10a17d000e06bf0e3e1088eaf6553af0cd2068 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<String>) 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);
}
}
@@ -191,6 +193,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;