diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockPoweredRail.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/level/block/BlockPoweredRail.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockPoweredRail.patch b/patch-remap/og/net/minecraft/world/level/block/BlockPoweredRail.patch new file mode 100644 index 0000000000..96b338866d --- /dev/null +++ b/patch-remap/og/net/minecraft/world/level/block/BlockPoweredRail.patch @@ -0,0 +1,25 @@ +--- a/net/minecraft/world/level/block/BlockPoweredRail.java ++++ b/net/minecraft/world/level/block/BlockPoweredRail.java +@@ -12,6 +12,8 @@ + import net.minecraft.world.level.block.state.properties.BlockStateEnum; + import net.minecraft.world.level.block.state.properties.IBlockState; + ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit ++ + public class BlockPoweredRail extends BlockMinecartTrackAbstract { + + public static final MapCodec<BlockPoweredRail> CODEC = simpleCodec(BlockPoweredRail::new); +@@ -120,6 +122,13 @@ + boolean flag1 = world.hasNeighborSignal(blockposition) || this.findPoweredRailSignal(world, blockposition, iblockdata, true, 0) || this.findPoweredRailSignal(world, blockposition, iblockdata, false, 0); + + if (flag1 != flag) { ++ // CraftBukkit start ++ int power = flag ? 15 : 0; ++ int newPower = CraftEventFactory.callRedstoneChange(world, blockposition, power, 15 - power).getNewCurrent(); ++ if (newPower == power) { ++ return; ++ } ++ // CraftBukkit end + world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockPoweredRail.POWERED, flag1), 3); + world.updateNeighborsAt(blockposition.below(), this); + if (((BlockPropertyTrackPosition) iblockdata.getValue(BlockPoweredRail.SHAPE)).isAscending()) { |