PaperMC/nms-patches/BlockRedstoneWire.patch
Thinkofdeath 24557bc2b3 Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
2014-11-28 17:16:30 +11:00

27 lines
1 KiB
Diff

--- ../work/decompile-bb26c12b/net/minecraft/server/BlockRedstoneWire.java 2014-11-27 08:59:46.569422428 +1100
+++ src/main/java/net/minecraft/server/BlockRedstoneWire.java 2014-11-27 08:42:10.136850942 +1100
@@ -8,6 +8,8 @@
import java.util.Random;
import java.util.Set;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneWire extends Block {
public static final BlockStateEnum NORTH = BlockStateEnum.of("north", EnumRedstoneWireConnection.class);
@@ -123,6 +125,15 @@
if (k > j - 1) {
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.set(BlockRedstoneWire.POWER, Integer.valueOf(j));