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 199eb742c..7c22983cd 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -158,7 +158,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Player player = event.getPlayer(); final Location f = event.getFrom(); final Location t = event.getTo(); - final Location q = new Location(t.getWorld(), t.getBlockX(), t.getBlockY(), t.getZ()); + final Location q = new Location(t.getWorld(), t.getBlockX(), 0, t.getZ()); if ((f.getBlockX() != q.getBlockX()) || (f.getBlockZ() != q.getBlockZ())) { if (!isPlotWorld(player.getWorld())) { @@ -202,8 +202,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } plotEntry(player, plot); } - } else if (leftPlot(f, q)) { - plot = getCurrentPlot(event.getFrom()); + } else if (leftPlot(f, event.getTo())) { + plot = getCurrentPlot(f); plotExit(player, plot); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java index 7e78fd2b3..3a5fb92b6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java @@ -113,15 +113,15 @@ import com.intellectualcrafters.plot.util.UUIDHandler; } public static boolean enteredPlot(final Location l1, final Location l2) { - final PlotId p1 = PlayerFunctions.getPlot(new Location(l1.getWorld(), l1.getBlockX(), 64, l1.getBlockZ())); - final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 64, l2.getBlockZ())); + final PlotId p1 = PlayerFunctions.getPlot(new Location(l1.getWorld(), l1.getBlockX(), 0, l1.getBlockZ())); + final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 0, l2.getBlockZ())); return (p2 != null) && ((p1 == null) || !p1.equals(p2)); } public static boolean leftPlot(final Location l1, final Location l2) { - final PlotId p1 = PlayerFunctions.getPlot(new Location(l1.getWorld(), l1.getBlockX(), 64, l1.getBlockZ())); - final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 64, l2.getBlockZ())); + final PlotId p1 = PlayerFunctions.getPlot(new Location(l1.getWorld(), l1.getBlockX(), 0, l1.getBlockZ())); + final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 0, l2.getBlockZ())); return (p1 != null) && ((p2 == null) || !p1.equals(p2)); } @@ -152,7 +152,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler; } else { return WeatherType.CLEAR; } - } + } private static GameMode getGameMode(final String str) { switch (str) {