From 7e21fdd86224a50cbad43a7b1a66f40cc6cb3790 Mon Sep 17 00:00:00 2001 From: Marco Cunha Date: Mon, 10 Sep 2012 01:53:16 +0300 Subject: [PATCH] Fix ore dupe bug with ore blocks on pistons --- .../java/com/gmail/nossr50/listeners/BlockListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index d952f3dca..37849d1a0 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -58,11 +58,15 @@ public class BlockListener implements Listener { public void onBlockPistonExtend(BlockPistonExtendEvent event) { List blocks = event.getBlocks(); BlockFace direction = event.getDirection(); + // Block that would be air after piston is finished + Block futureEmptyBlock = event.getBlock().getRelative(direction); for (Block b : blocks) { if (mcMMO.placeStore.isTrue(b)) { b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true)); - mcMMO.placeStore.setFalse(b); + if (b.equals(futureEmptyBlock)) { + mcMMO.placeStore.setFalse(b); + } } }