From 9a359bf42c44d76f491fbb833db217d876128e7c Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Tue, 11 Mar 2014 13:28:56 +0100 Subject: [PATCH] We need to use event.getBlock() here Fix my boo boo from previous commit --- .../java/com/gmail/nossr50/listeners/BlockListener.java | 2 +- .../gmail/nossr50/runnables/StickyPistonTrackerTask.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index f6224ed06..de028e9a4 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -97,7 +97,7 @@ public class BlockListener implements Listener { Block movedBlock = event.getRetractLocation().getBlock(); // Needed only because under some circumstances Minecraft doesn't move the block - new StickyPistonTrackerTask(event.getDirection(), movedBlock).runTaskLater(plugin, 2); + new StickyPistonTrackerTask(event.getDirection(), event.getBlock(), movedBlock).runTaskLater(plugin, 2); } /** diff --git a/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java b/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java index 0324a8f73..28797b04f 100644 --- a/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/StickyPistonTrackerTask.java @@ -10,10 +10,12 @@ import com.gmail.nossr50.util.BlockUtils; public class StickyPistonTrackerTask extends BukkitRunnable { private BlockFace direction; + private Block block; private Block movedBlock; - public StickyPistonTrackerTask(BlockFace direction, Block movedBlock) { + public StickyPistonTrackerTask(BlockFace direction, Block block, Block movedBlock) { this.direction = direction; + this.block = block; this.movedBlock = movedBlock; } @@ -24,6 +26,6 @@ public class StickyPistonTrackerTask extends BukkitRunnable { } mcMMO.getPlaceStore().setFalse(movedBlock); - mcMMO.getPlaceStore().setTrue(movedBlock.getRelative(direction)); + mcMMO.getPlaceStore().setTrue(block.getRelative(direction)); } }