Further fix to Location.
This commit is contained in:
parent
af8b5d0b9b
commit
db392bc0f2
@ -373,8 +373,10 @@ public class Location implements Cloneable {
|
|||||||
*/
|
*/
|
||||||
public double distanceSquared(Location o) {
|
public double distanceSquared(Location o) {
|
||||||
if (o == null) {
|
if (o == null) {
|
||||||
|
throw new IllegalArgumentException("Cannot measure distance to a null location");
|
||||||
|
} else if (o.getWorld() == null || getWorld() == null) {
|
||||||
throw new IllegalArgumentException("Cannot measure distance to a null world");
|
throw new IllegalArgumentException("Cannot measure distance to a null world");
|
||||||
} else if (o == null || o.getWorld() != getWorld()) {
|
} else if (o.getWorld() != getWorld()) {
|
||||||
throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getName() + " and " + o.getWorld().getName());
|
throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getName() + " and " + o.getWorld().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user