diff options
author | Erik Broes <erikbroes@ripe.net> | 2011-03-02 16:36:09 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@ripe.net> | 2011-03-02 16:36:26 +0100 |
commit | 1505b4bf3c3da0ea392d2334f197fdfb78579cb0 (patch) | |
tree | ed85330894567c18f298bb4ae2979f0d28c2d1bd /src | |
parent | 9d9ad6bd1e2bfaf08b7aa530cb101e1bd00118db (diff) | |
download | craftbukkit-1505b4bf3c3da0ea392d2334f197fdfb78579cb0.tar craftbukkit-1505b4bf3c3da0ea392d2334f197fdfb78579cb0.tar.gz craftbukkit-1505b4bf3c3da0ea392d2334f197fdfb78579cb0.tar.lz craftbukkit-1505b4bf3c3da0ea392d2334f197fdfb78579cb0.tar.xz craftbukkit-1505b4bf3c3da0ea392d2334f197fdfb78579cb0.zip |
RedstoneChange event thrown then the redstone *changes* not when it stays the same :D
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPressurePlate.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPressurePlate.java b/src/main/java/net/minecraft/server/BlockPressurePlate.java index 85f5e00d..fc8a940f 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlate.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlate.java @@ -114,12 +114,14 @@ public class BlockPressurePlate extends Block { } // CraftBukkit start - CraftWorld craftWorld = ((WorldServer) world).getWorld(); - CraftServer server = ((WorldServer) world).getServer(); - CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k); - BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 1 : 0, flag1 ? 1 : 0); - server.getPluginManager().callEvent(eventRedstone); - flag1 = eventRedstone.getNewCurrent() > 0; + if (flag != flag1) { + CraftWorld craftWorld = ((WorldServer) world).getWorld(); + CraftServer server = ((WorldServer) world).getServer(); + CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k); + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 1 : 0, flag1 ? 1 : 0); + server.getPluginManager().callEvent(eventRedstone); + flag1 = eventRedstone.getNewCurrent() > 0; + } // CraftBukkit end if (flag1 && !flag) { |