summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorTahg <tahgtahv@gmail.com>2012-01-10 00:20:03 -0500
committerTahg <tahgtahv@gmail.com>2012-01-10 00:20:43 -0500
commitdb392bc0f2fd8fcf6f74b8a76147684d200a6fc5 (patch)
tree797a944945f5fb9572342d9bea225f399d2cef5c /src/main
parentaf8b5d0b9bd33bb6b345ab4e9d6956368ab09e6e (diff)
downloadbukkit-db392bc0f2fd8fcf6f74b8a76147684d200a6fc5.tar
bukkit-db392bc0f2fd8fcf6f74b8a76147684d200a6fc5.tar.gz
bukkit-db392bc0f2fd8fcf6f74b8a76147684d200a6fc5.tar.lz
bukkit-db392bc0f2fd8fcf6f74b8a76147684d200a6fc5.tar.xz
bukkit-db392bc0f2fd8fcf6f74b8a76147684d200a6fc5.zip
Further fix to Location.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/Location.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 4afabd88..3760f5a2 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -373,8 +373,10 @@ public class Location implements Cloneable {
*/
public double distanceSquared(Location o) {
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");
- } 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());
}