From 4b9c0d0a1ca6bb9956dc418b31ac7bab4b85b67c Mon Sep 17 00:00:00 2001 From: taoneill Date: Sun, 20 Mar 2011 18:01:06 -0400 Subject: [PATCH] Lobby gates in other NORMAL worlds should now work. Nether lobbies are still broken, though. --- war/src/main/java/bukkit/tommytony/war/War.java | 3 ++- war/src/main/java/com/tommytony/war/volumes/Volume.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/war/src/main/java/bukkit/tommytony/war/War.java b/war/src/main/java/bukkit/tommytony/war/War.java index b16efb8..ae1ca3e 100644 --- a/war/src/main/java/bukkit/tommytony/war/War.java +++ b/war/src/main/java/bukkit/tommytony/war/War.java @@ -1212,7 +1212,8 @@ public class War extends JavaPlugin { public Warzone warzone(Location location) { for(Warzone warzone : warzones) { - if(warzone.getVolume() != null && warzone.getVolume().contains(location)) return warzone; + if(location.getWorld().getName().equals(warzone.getWorld().getName()) + && warzone.getVolume() != null && warzone.getVolume().contains(location)) return warzone; } return null; } diff --git a/war/src/main/java/com/tommytony/war/volumes/Volume.java b/war/src/main/java/com/tommytony/war/volumes/Volume.java index 72cfe93..58c0476 100644 --- a/war/src/main/java/com/tommytony/war/volumes/Volume.java +++ b/war/src/main/java/com/tommytony/war/volumes/Volume.java @@ -366,7 +366,7 @@ public class Volume { int y = location.getBlockY(); int z = location.getBlockZ(); return hasTwoCorners() && - location.getWorld() == world && + location.getWorld().getName().equals(world.getName()) && x <= getMaxX() && x >= getMinX() && y <= getMaxY() && y >= getMinY() && z <= getMaxZ() && z >= getMinZ(); @@ -377,7 +377,7 @@ public class Volume { int y = block.getY(); int z = block.getZ(); return hasTwoCorners() && - block.getWorld() == world && + block.getWorld().getName().equals(world.getName()) && x <= getMaxX() && x >= getMinX() && y <= getMaxY() && y >= getMinY() && z <= getMaxZ() && z >= getMinZ();