From 6afcce4b7c7550c86a1741b33ac5f9e5b222a1c8 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 20 Mar 2012 13:03:52 -0400 Subject: [PATCH] Piston listeners weren't tracking the last pushed block. --- .../java/com/gmail/nossr50/listeners/mcBlockListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index e5fda341b..57ab38fa2 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -69,9 +69,9 @@ public class mcBlockListener implements Listener { } for (Block b : blocks) { - if (b.hasMetadata("mcmmoNeedsTracking")) { - b.setMetadata("mcmmoPlacedBlock", new FixedMetadataValue(plugin, true)); - b.removeMetadata("mcmmoNeedsTracking", plugin); + if (b.getRelative(direction).hasMetadata("mcmmoNeedsTracking")) { + b.getRelative(direction).setMetadata("mcmmoPlacedBlock", new FixedMetadataValue(plugin, true)); + b.getRelative(direction).removeMetadata("mcmmoNeedsTracking", plugin); } } } @@ -87,7 +87,7 @@ public class mcBlockListener implements Listener { if (block.hasMetadata("mcmmoPlacedBlock")) { block.removeMetadata("mcmmoPlacedBlock", plugin); - event.getBlock().getRelative(event.getDirection(), 1).setMetadata("mcmmoPlacedBlock", new FixedMetadataValue(plugin, true)); + event.getBlock().getRelative(event.getDirection()).setMetadata("mcmmoPlacedBlock", new FixedMetadataValue(plugin, true)); } }