fixed plot exit (gamemode flag)

This commit is contained in:
boy0001 2015-02-08 13:19:46 +11:00
parent ef5653330c
commit bf49ff20d0
2 changed files with 8 additions and 8 deletions

View File

@ -158,7 +158,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final Location f = event.getFrom(); final Location f = event.getFrom();
final Location t = event.getTo(); 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 ((f.getBlockX() != q.getBlockX()) || (f.getBlockZ() != q.getBlockZ())) {
if (!isPlotWorld(player.getWorld())) { if (!isPlotWorld(player.getWorld())) {
@ -202,8 +202,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} }
plotEntry(player, plot); plotEntry(player, plot);
} }
} else if (leftPlot(f, q)) { } else if (leftPlot(f, event.getTo())) {
plot = getCurrentPlot(event.getFrom()); plot = getCurrentPlot(f);
plotExit(player, plot); plotExit(player, plot);
} }
} }

View File

@ -113,15 +113,15 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
} }
public static boolean enteredPlot(final Location l1, final Location l2) { 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 p1 = PlayerFunctions.getPlot(new Location(l1.getWorld(), l1.getBlockX(), 0, l1.getBlockZ()));
final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 64, l2.getBlockZ())); final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 0, l2.getBlockZ()));
return (p2 != null) && ((p1 == null) || !p1.equals(p2)); return (p2 != null) && ((p1 == null) || !p1.equals(p2));
} }
public static boolean leftPlot(final Location l1, final Location l2) { 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 p1 = PlayerFunctions.getPlot(new Location(l1.getWorld(), l1.getBlockX(), 0, l1.getBlockZ()));
final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 64, l2.getBlockZ())); final PlotId p2 = PlayerFunctions.getPlot(new Location(l2.getWorld(), l2.getBlockX(), 0, l2.getBlockZ()));
return (p1 != null) && ((p2 == null) || !p1.equals(p2)); return (p1 != null) && ((p2 == null) || !p1.equals(p2));
} }
@ -152,7 +152,7 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
} else { } else {
return WeatherType.CLEAR; return WeatherType.CLEAR;
} }
} }
private static GameMode getGameMode(final String str) { private static GameMode getGameMode(final String str) {
switch (str) { switch (str) {