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)); } }