mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 22:13:42 +01:00
25 lines
1.2 KiB
Diff
25 lines
1.2 KiB
Diff
--- a/net/minecraft/server/BlockPoweredRail.java
|
|
+++ b/net/minecraft/server/BlockPoweredRail.java
|
|
@@ -1,5 +1,7 @@
|
|
package net.minecraft.server;
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
+
|
|
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
|
|
|
|
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.ad;
|
|
@@ -102,6 +104,13 @@
|
|
boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(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.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, flag1), 3);
|
|
world.applyPhysics(blockposition.down(), this);
|
|
if (((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)).c()) {
|