diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockObserver.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/level/block/BlockObserver.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockObserver.patch b/patch-remap/og/net/minecraft/world/level/block/BlockObserver.patch new file mode 100644 index 0000000000..dae36bc563 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/level/block/BlockObserver.patch @@ -0,0 +1,30 @@ +--- a/net/minecraft/world/level/block/BlockObserver.java ++++ b/net/minecraft/world/level/block/BlockObserver.java +@@ -15,6 +15,8 @@ + import net.minecraft.world.level.block.state.properties.BlockProperties; + import net.minecraft.world.level.block.state.properties.BlockStateBoolean; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++ + public class BlockObserver extends BlockDirectional { + + public static final MapCodec<BlockObserver> CODEC = simpleCodec(BlockObserver::new); +@@ -48,8 +50,18 @@ + @Override + public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) { + if ((Boolean) iblockdata.getValue(BlockObserver.POWERED)) { ++ // CraftBukkit start ++ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) { ++ return; ++ } ++ // CraftBukkit end + worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockObserver.POWERED, false), 2); + } else { ++ // CraftBukkit start ++ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) { ++ return; ++ } ++ // CraftBukkit end + worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockObserver.POWERED, true), 2); + worldserver.scheduleTick(blockposition, (Block) this, 2); + } |