Game: Change GameFlagManager to use Game.isInsideMap(), change isInsideMap to treat MaxX,Y,Z with a +1

This commit is contained in:
libraryaddict 2015-05-24 20:10:16 +12:00
parent f899194e3b
commit 0d0d5eea64
2 changed files with 4 additions and 9 deletions

View File

@ -1281,10 +1281,10 @@ public abstract class Game implements Listener
return !(
loc.getX() >= WorldData.MaxX ||
loc.getX() <= WorldData.MinX ||
loc.getZ() >= WorldData.MaxZ ||
loc.getZ() <= WorldData.MinZ ||
loc.getZ() >= WorldData.MaxZ + 1 ||
loc.getZ() <= WorldData.MinZ + 1 ||
loc.getY() >= WorldData.MaxY ||
loc.getY() <= WorldData.MinY);
loc.getY() <= WorldData.MinY + 1);
}
public void setItemMerge(boolean itemMerge)

View File

@ -840,12 +840,7 @@ public class GameFlagManager implements Listener
for (Player player : UtilServer.getPlayers())
{
if (player.getLocation().getX() > game.WorldData.MaxX ||
player.getLocation().getX() < game.WorldData.MinX ||
player.getLocation().getZ() > game.WorldData.MaxZ ||
player.getLocation().getZ() < game.WorldData.MinZ ||
((player.getLocation().getY() > game.WorldData.MaxY ||
player.getLocation().getY() < game.WorldData.MinY) && game.IsAlive(player)))
if (!game.isInsideMap(player.getLocation()) && game.IsAlive(player))
{
if (!Manager.IsAlive(player) || ((CraftPlayer)player).getHandle().spectating)
{