From 80b93b36825e9aa465fa56b6458c4d820eafe044 Mon Sep 17 00:00:00 2001 From: Bluemangoo Date: Fri, 4 Oct 2024 00:59:32 +0800 Subject: [PATCH] Make lever and cocoa wrench-able by shear --- patches/server/0012-Redstone-Shears-Wrench.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/patches/server/0012-Redstone-Shears-Wrench.patch b/patches/server/0012-Redstone-Shears-Wrench.patch index 90c0828f..4c13669e 100644 --- a/patches/server/0012-Redstone-Shears-Wrench.patch +++ b/patches/server/0012-Redstone-Shears-Wrench.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Redstone Shears Wrench diff --git a/src/main/java/net/minecraft/world/item/ShearsItem.java b/src/main/java/net/minecraft/world/item/ShearsItem.java -index cb809796372a4658aa617404f9fddffff9b45cb7..8ebd9da5c6acf9bd220f09922ea27a7c97f4ea2f 100644 +index cb809796372a4658aa617404f9fddffff9b45cb7..6ec6f786fda5a6d3f28e4e3d29a9754edb0356d0 100644 --- a/src/main/java/net/minecraft/world/item/ShearsItem.java +++ b/src/main/java/net/minecraft/world/item/ShearsItem.java -@@ -19,6 +19,21 @@ import net.minecraft.world.level.block.GrowingPlantHeadBlock; +@@ -19,6 +19,23 @@ import net.minecraft.world.level.block.GrowingPlantHeadBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.gameevent.GameEvent; @@ -22,6 +22,8 @@ index cb809796372a4658aa617404f9fddffff9b45cb7..8ebd9da5c6acf9bd220f09922ea27a7c +import net.minecraft.world.level.block.ObserverBlock; +import net.minecraft.world.level.block.RepeaterBlock; +import net.minecraft.world.level.block.CrafterBlock; ++import net.minecraft.world.level.block.LeverBlock; ++import net.minecraft.world.level.block.CocoaBlock; +import net.minecraft.world.level.block.piston.PistonBaseBlock; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.Property; @@ -30,7 +32,7 @@ index cb809796372a4658aa617404f9fddffff9b45cb7..8ebd9da5c6acf9bd220f09922ea27a7c public class ShearsItem extends Item { public ShearsItem(Item.Properties settings) { super(settings); -@@ -77,6 +92,67 @@ public class ShearsItem extends Item { +@@ -77,6 +94,67 @@ public class ShearsItem extends Item { return InteractionResult.sidedSuccess(level.isClientSide); } @@ -38,7 +40,7 @@ index cb809796372a4658aa617404f9fddffff9b45cb7..8ebd9da5c6acf9bd220f09922ea27a7c + Block block = blockState.getBlock(); + if (org.leavesmc.leaves.LeavesConfig.redstoneShearsWrench && block instanceof ObserverBlock || block instanceof DispenserBlock || + block instanceof PistonBaseBlock || block instanceof HopperBlock || block instanceof RepeaterBlock || block instanceof ComparatorBlock || -+ block instanceof CrafterBlock) { ++ block instanceof CrafterBlock || block instanceof LeverBlock || block instanceof CocoaBlock) { + StateDefinition blockstatelist = block.getStateDefinition(); + Property iblockstate = block instanceof CrafterBlock ? blockstatelist.getProperty("orientation") : blockstatelist.getProperty("facing"); + Player player = context.getPlayer();