RedstoneChange event thrown then the redstone *changes* not when it stays the same :D

This commit is contained in:
Erik Broes 2011-03-02 16:36:09 +01:00
parent 9d9ad6bd1e
commit 1505b4bf3c

View File

@ -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) {