2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockTripwireHook.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockTripwireHook.java
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -27,6 +27,8 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockTripwireHook extends Block {
|
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -161,6 +163,17 @@
|
|
|
|
this.emitState(world, blockposition1, flag4, flag5, flag2, flag3);
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
|
|
+
|
|
|
|
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 15, 0);
|
2021-06-11 13:33:49 +02:00
|
|
|
+ world.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
|
|
|
+ if (eventRedstone.getNewCurrent() > 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2022-06-07 18:00:00 +02:00
|
|
|
this.emitState(world, blockposition, flag4, flag5, flag2, flag3);
|
2014-11-25 22:32:16 +01:00
|
|
|
if (!flag) {
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata3.setValue(BlockTripwireHook.FACING, enumdirection), 3);
|