3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/nms-patches/BlockPoweredRail.patch

25 Zeilen
1.2 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockPoweredRail.java
+++ b/net/minecraft/server/BlockPoweredRail.java
2018-07-15 02:00:00 +02:00
@@ -1,5 +1,7 @@
package net.minecraft.server;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
2019-04-23 04:00:00 +02:00
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.X;
@@ -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
2018-07-15 02:00:00 +02:00
+ int power = flag ? 15 : 0;
+ int newPower = CraftEventFactory.callRedstoneChange(world, blockposition, power, 15 - power).getNewCurrent();
+ if (newPower == power) {
+ return;
+ }
+ // CraftBukkit end
2018-12-06 00:00:00 +01:00
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockPoweredRail.POWERED, flag1), 3);
2018-07-15 02:00:00 +02:00
world.applyPhysics(blockposition.down(), this);
2019-12-10 23:00:00 +01:00
if (((BlockPropertyTrackPosition) iblockdata.get(BlockPoweredRail.SHAPE)).b()) {