|
@@ -157,7 +157,11 @@ public class m {
|
|
|
* @return true if the distance between <code>first</code> and <code>second</code> is less than <code>maxDistance</code>, 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 {
|