diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch new file mode 100644 index 0000000000..dc5eef8e62 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DiodeBlock.java.patch @@ -0,0 +1,44 @@ +--- 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 { + protected static final VoxelShape SHAPE = Block.box(0.0, 0.0, 0.0, 16.0, 2.0, 16.0); +@@ -50,15 +53,26 @@ + @Override + public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + if (!this.isLocked(level, pos, state)) { +- boolean flag = state.getValue(POWERED); +- boolean shouldTurnOn = this.shouldTurnOn(level, pos, state); +- if (flag && !shouldTurnOn) { +- level.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(false)), 2); ++ boolean flag = (Boolean) state.getValue(DiodeBlock.POWERED); ++ boolean flag1 = this.shouldTurnOn(level, pos, state); ++ ++ if (flag && !flag1) { ++ // 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) { +- level.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(true)), 2); +- if (!shouldTurnOn) { +- level.scheduleTick(pos, this, this.getDelay(state), TickPriority.VERY_HIGH); ++ // 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) { ++ level.scheduleTick(pos, (Block) this, this.getDelay(state), TickPriority.VERY_HIGH); ++ } + } + } + } |