diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch new file mode 100644 index 0000000000..6a6f9087df --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch @@ -0,0 +1,32 @@ +--- a/net/minecraft/world/level/block/DiodeBlock.java ++++ b/net/minecraft/world/level/block/DiodeBlock.java +@@ -20,6 +20,7 @@ + import net.minecraft.world.phys.shapes.CollisionContext; + import net.minecraft.world.phys.shapes.VoxelShape; + import net.minecraft.world.ticks.TickPriority; ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public abstract class DiodeBlock extends HorizontalDirectionalBlock { + +@@ -60,9 +57,19 @@ + boolean flag1 = this.shouldTurnOn(serverlevel, blockpos, blockstate); + + if (flag && !flag1) { +- serverlevel.setBlock(blockpos, (BlockState) blockstate.setValue(DiodeBlock.POWERED, false), 2); ++ // CraftBukkit start ++ if (CraftEventFactory.callRedstoneChange(level, pos, 15, 0).getNewCurrent() != 0) { ++ return; ++ } ++ // CraftBukkit end ++ level.setBlock(pos, (IBlockData) state.setValue(DiodeBlock.POWERED, false), 2); + } else if (!flag) { +- serverlevel.setBlock(blockpos, (BlockState) blockstate.setValue(DiodeBlock.POWERED, true), 2); ++ // CraftBukkit start ++ if (CraftEventFactory.callRedstoneChange(level, pos, 0, 15).getNewCurrent() != 15) { ++ return; ++ } ++ // CraftBukkit end ++ level.setBlock(pos, (IBlockData) state.setValue(DiodeBlock.POWERED, true), 2); + if (!flag1) { + serverlevel.scheduleTick(blockpos, (Block) this, this.getDelay(blockstate), TickPriority.VERY_HIGH); + } |