aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/TripWireHookBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/TripWireHookBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/TripWireHookBlock.java.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/TripWireHookBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/TripWireHookBlock.java.patch
new file mode 100644
index 0000000000..788243b667
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/TripWireHookBlock.java.patch
@@ -0,0 +1,39 @@
+--- a/net/minecraft/world/level/block/TripWireHookBlock.java
++++ b/net/minecraft/world/level/block/TripWireHookBlock.java
+@@ -28,6 +28,10 @@
+ import net.minecraft.world.level.gameevent.GameEvent;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++// CraftBukkit start
++import org.bukkit.craftbukkit.block.CraftBlock;
++import org.bukkit.event.block.BlockRedstoneEvent;
++// CraftBukkit end
+
+ public class TripWireHookBlock extends Block {
+
+@@ -179,11 +177,20 @@
+ emitState(level, blockpos1, flag4, flag5, flag2, flag3);
+ }
+
+- emitState(level, blockpos, flag4, flag5, flag2, flag3);
+- if (!flag) {
+- level.setBlock(blockpos, (BlockState) blockstate3.setValue(TripWireHookBlock.FACING, direction), 3);
+- if (flag1) {
+- notifyNeighbors(block, level, blockpos, direction);
++ // CraftBukkit start
++ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(CraftBlock.at(world, level), 15, 0);
++ world.getCraftServer().getPluginManager().callEvent(eventRedstone);
++
++ if (eventRedstone.getNewCurrent() > 0) {
++ return;
++ }
++ // CraftBukkit end
++
++ emitState(world, level, flag4, flag5, flag2, flag3);
++ if (!hookState) {
++ world.setBlock(level, (IBlockData) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
++ if (attaching) {
++ notifyNeighbors(block, world, level, enumdirection);
+ }
+ }
+