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 {