From 6a858dace7318e903ad96e49a3d0f11a5e4ba7c0 Mon Sep 17 00:00:00 2001 From: GJ Date: Sun, 1 Apr 2012 16:30:16 -0400 Subject: [PATCH] Fixed calculating party bonus XP when players are in different worlds throwing errors. --- src/main/java/com/gmail/nossr50/m.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/m.java b/src/main/java/com/gmail/nossr50/m.java index 1779cbb25..ca7d2c948 100644 --- a/src/main/java/com/gmail/nossr50/m.java +++ b/src/main/java/com/gmail/nossr50/m.java @@ -157,7 +157,11 @@ public class m { * @return true if the distance between first and second is less than maxDistance, false otherwise */ public static boolean isNear(Location first, Location second, double maxDistance) { - if (first.distance(second) < maxDistance) { + if (!first.getWorld().equals(second.getWorld())) { + return false; + } + + if (first.distanceSquared(second) < (maxDistance * maxDistance)) { return true; } else {