mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
fixed plot exit (gamemode flag)
This commit is contained in:
parent
ef5653330c
commit
bf49ff20d0
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user