mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
43702a9e10
By: md_5 <git@md-5.net>
25 lines
1.4 KiB
Diff
25 lines
1.4 KiB
Diff
--- a/net/minecraft/world/level/block/BlockPoweredRail.java
|
|
+++ b/net/minecraft/world/level/block/BlockPoweredRail.java
|
|
@@ -11,6 +11,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 BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.RAIL_SHAPE_STRAIGHT;
|
|
@@ -113,6 +115,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()) {
|