From 271cc026d450b33cce07b19ba164b08e6601ae60 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 15 Mar 2015 21:40:55 +1100 Subject: [PATCH] Fixed piston retract (finally) --- .../com/intellectualcrafters/plot/listeners/PlayerEvents.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 9f2b355da..561707039 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -546,7 +546,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } Plot plot = MainUtil.getPlot(loc); if (plot != null) { - Location bloc = BukkitUtil.getLocation(block.getLocation().subtract(block.getRelative(event.getDirection()).getRelative(event.getDirection()).getLocation())); + BlockFace dir = event.getDirection(); + Location bloc = BukkitUtil.getLocation(block.getLocation().subtract(dir.getModX() * 2, dir.getModY() * 2, dir.getModZ() * 2)); Plot newPlot = MainUtil.getPlot(bloc); if (!plot.equals(newPlot)) { event.setCancelled(true);