Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/nms-patches/BlockRedstoneWire.patch
2018-12-06 10:00:00 +11:00

28 Zeilen
983 B
Diff

--- a/net/minecraft/server/BlockRedstoneWire.java
+++ b/net/minecraft/server/BlockRedstoneWire.java
@@ -11,6 +11,8 @@
import java.util.Set;
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneWire extends Block {
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.M;
@@ -216,6 +218,15 @@
j = k;
}
+ // CraftBukkit start
+ if (i != j) {
+ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), i, j);
+ world.getServer().getPluginManager().callEvent(event);
+
+ j = event.getNewCurrent();
+ }
+ // CraftBukkit end
+
if (i != j) {
iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, j);
if (world.getType(blockposition) == iblockdata1) {