diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/ObserverBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/ObserverBlock.java.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/ObserverBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/ObserverBlock.java.patch new file mode 100644 index 0000000000..8d0c96f787 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/ObserverBlock.java.patch @@ -0,0 +1,38 @@ +--- a/net/minecraft/world/level/block/ObserverBlock.java ++++ b/net/minecraft/world/level/block/ObserverBlock.java +@@ -14,6 +14,7 @@ + import net.minecraft.world.level.block.state.StateDefinition; + import net.minecraft.world.level.block.state.properties.BlockStateProperties; + import net.minecraft.world.level.block.state.properties.BooleanProperty; ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class ObserverBlock extends DirectionalBlock { + public static final MapCodec<ObserverBlock> CODEC = simpleCodec(ObserverBlock::new); +@@ -45,12 +47,22 @@ + } + + @Override +- public void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { +- if (state.getValue(POWERED)) { +- level.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(false)), 2); ++ public void tick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) { ++ if ((Boolean) state.getValue(ObserverBlock.POWERED)) { ++ // CraftBukkit start ++ if (CraftEventFactory.callRedstoneChange(level, pos, 15, 0).getNewCurrent() != 0) { ++ return; ++ } ++ // CraftBukkit end ++ level.setBlock(pos, (IBlockData) state.setValue(ObserverBlock.POWERED, false), 2); + } else { +- level.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(true)), 2); +- level.scheduleTick(pos, this, 2); ++ // CraftBukkit start ++ if (CraftEventFactory.callRedstoneChange(level, pos, 0, 15).getNewCurrent() != 15) { ++ return; ++ } ++ // CraftBukkit end ++ level.setBlock(pos, (IBlockData) state.setValue(ObserverBlock.POWERED, true), 2); ++ level.scheduleTick(pos, (Block) this, 2); + } + + this.updateNeighborsInFront(level, pos, state); |