aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockDiodeAbstract.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockDiodeAbstract.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockDiodeAbstract.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockDiodeAbstract.patch b/patch-remap/og/net/minecraft/world/level/block/BlockDiodeAbstract.patch
new file mode 100644
index 0000000000..6f3a7b9965
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockDiodeAbstract.patch
@@ -0,0 +1,30 @@
+--- a/net/minecraft/world/level/block/BlockDiodeAbstract.java
++++ b/net/minecraft/world/level/block/BlockDiodeAbstract.java
+@@ -21,6 +21,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.ticks.TickListPriority;
+
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++
+ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
+
+ protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
+@@ -56,8 +58,18 @@
+ boolean flag1 = this.shouldTurnOn(worldserver, blockposition, iblockdata);
+
+ if (flag && !flag1) {
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
++ return;
++ }
++ // CraftBukkit end
+ worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockDiodeAbstract.POWERED, false), 2);
+ } else if (!flag) {
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) {
++ return;
++ }
++ // CraftBukkit end
+ worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockDiodeAbstract.POWERED, true), 2);
+ if (!flag1) {
+ worldserver.scheduleTick(blockposition, (Block) this, this.getDelay(iblockdata), TickListPriority.VERY_HIGH);