summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorGJ <gjmcferrin@gmail.com>2014-01-26 01:05:27 -0800
committerTravis Watkins <amaranth@ubuntu.com>2014-04-18 10:29:07 -0500
commit7df7778ccb13aab76f672f06eea021d2d6020808 (patch)
tree8bee44c2e4a7d58e70d479291f81d0af5f4a02a5 /src/main/java/net/minecraft/server
parent610c58c733fe4e2ddb50b2a5c37358f436aeea4d (diff)
downloadcraftbukkit-7df7778ccb13aab76f672f06eea021d2d6020808.tar
craftbukkit-7df7778ccb13aab76f672f06eea021d2d6020808.tar.gz
craftbukkit-7df7778ccb13aab76f672f06eea021d2d6020808.tar.lz
craftbukkit-7df7778ccb13aab76f672f06eea021d2d6020808.tar.xz
craftbukkit-7df7778ccb13aab76f672f06eea021d2d6020808.zip
[Bleeding] Call BlockRedstoneEvent for all rails. Adds BUKKIT-4080
Previously, Detector Rails were the only rails that properly called BlockRedstoneEvent when they changed from powered to unpowered. This commit adds BlockRedstoneEvent calls for both Powered Rails and Activator Rails.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/BlockPoweredRail.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPoweredRail.java b/src/main/java/net/minecraft/server/BlockPoweredRail.java
index aa84a975..cd209058 100644
--- a/src/main/java/net/minecraft/server/BlockPoweredRail.java
+++ b/src/main/java/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 {
protected BlockPoweredRail() {
super(true);
@@ -115,9 +117,21 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract {
boolean flag1 = false;
if (flag && (l & 0x8) == 0) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() <= 0) {
+ return;
+ }
+ // CraftBukkit end
+
world.setData(i, j, k, i1 | 0x8, 3);
flag1 = true;
} else if (!flag && (l & 0x8) != 0) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, i, j, k, 15, 0).getNewCurrent() > 0) {
+ return;
+ }
+ // CraftBukkit end
+
world.setData(i, j, k, i1, 3);
flag1 = true;
}
@@ -129,4 +143,4 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract {
}
}
}
-} \ No newline at end of file
+}