diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-12-27 15:40:18 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-12-27 15:40:18 -0600 |
commit | 25732f0487570d17615c42560d36e85b9100518e (patch) | |
tree | 29c26611d566306a6473c9f639fe35453a87a5ba /src/main/java | |
parent | 186a679730b617b0d64dfa8e1d12e840da6c9d7e (diff) | |
download | craftbukkit-25732f0487570d17615c42560d36e85b9100518e.tar craftbukkit-25732f0487570d17615c42560d36e85b9100518e.tar.gz craftbukkit-25732f0487570d17615c42560d36e85b9100518e.tar.lz craftbukkit-25732f0487570d17615c42560d36e85b9100518e.tar.xz craftbukkit-25732f0487570d17615c42560d36e85b9100518e.zip |
Fire BlockRedstoneEvent for repeaters. Fixes BUKKIT-1157
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockDiode.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDiode.java b/src/main/java/net/minecraft/server/BlockDiode.java index 2580d5d8..2e06725d 100644 --- a/src/main/java/net/minecraft/server/BlockDiode.java +++ b/src/main/java/net/minecraft/server/BlockDiode.java @@ -2,6 +2,8 @@ package net.minecraft.server; import java.util.Random; +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + public class BlockDiode extends BlockDirectional { public static final double[] a = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D}; @@ -34,8 +36,20 @@ public class BlockDiode extends BlockDirectional { boolean flag1 = this.i(world, i, j, k, l); if (this.c && !flag1) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(world, i, j, k, 15, 0).getNewCurrent() != 0) { + return; + } + // CraftBukkit end + world.setTypeIdAndData(i, j, k, Block.DIODE_OFF.id, l); } else if (!this.c) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() != 15) { + return; + } + // CraftBukkit end + world.setTypeIdAndData(i, j, k, Block.DIODE_ON.id, l); if (!flag1) { int i1 = (l & 12) >> 2; |