mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26: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 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user