From 1505b4bf3c3da0ea392d2334f197fdfb78579cb0 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Wed, 2 Mar 2011 16:36:09 +0100 Subject: RedstoneChange event thrown then the redstone *changes* not when it stays the same :D --- src/main/java/net/minecraft/server/BlockPressurePlate.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/net/minecraft') 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) { -- cgit v1.2.3