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/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java index 976de81d65b6494cdad20f4ec5125fceec86f951..37f561ae2eca0d118c63f519fabdcfe9cb710826 100644 --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java @@ -557,6 +557,13 @@ public class Block extends BlockBehaviour implements ItemLike { } // Spigot end + // Leaves start - reset push reaction + @org.jetbrains.annotations.Nullable + public net.minecraft.world.level.material.PushReaction getResetPushReaction() { + return null; + } + // Leaves end - reset push reaction + record ShapePairKey(VoxelShape first, VoxelShape second) { @Override public boolean equals(Object other) { diff --git a/net/minecraft/world/level/block/BuddingAmethystBlock.java b/net/minecraft/world/level/block/BuddingAmethystBlock.java index f6850d3ab54a6eb4ff718d861f39aac2facd3a88..5f51b4689b0ea92eb7e4e5e42e9eb5538930d60d 100644 --- a/net/minecraft/world/level/block/BuddingAmethystBlock.java +++ b/net/minecraft/world/level/block/BuddingAmethystBlock.java @@ -58,4 +58,12 @@ public class BuddingAmethystBlock extends AmethystBlock { public static boolean canClusterGrowAtState(BlockState state) { return state.isAir() || state.is(Blocks.WATER) && state.getFluidState().getAmount() == 8; } + + // Leaves start - budding amethyst can push by piston + @Override + @org.jetbrains.annotations.Nullable + public net.minecraft.world.level.material.PushReaction getResetPushReaction() { + return org.leavesmc.leaves.LeavesConfig.modify.buddingAmethystCanPushByPiston ? net.minecraft.world.level.material.PushReaction.PUSH_ONLY : null; + } + // Leaves end - budding amethyst can push by piston } diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java index 5473b4006f7e0266ea11a7b05cef78a113c30d97..a37a5528b36ebade8b0e3fe570c6d4819ab1cfbf 100644 --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -766,7 +766,7 @@ public abstract class BlockBehaviour implements FeatureElement { } public PushReaction getPistonPushReaction() { - return !this.isDestroyable() ? PushReaction.BLOCK : this.pushReaction; // Paper - Protect Bedrock and End Portal/Frames from being destroyed + return !this.isDestroyable() ? PushReaction.BLOCK : this.getBlock().getResetPushReaction() == null ? this.pushReaction : this.getBlock().getResetPushReaction(); // Paper - Protect Bedrock and End Portal/Frames from being destroyed // Leaves - can reset } public boolean isSolidRender() {