mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
Revert "Improved some debug in Location."
This reverts commit 0569e71b26ffc88a5b752ce1217c3ba33e6586e9. By: EvilSeph <evilseph@gmail.com>
This commit is contained in:
parent
21e1a5b725
commit
0bc50733b5
1 changed files with 5 additions and 7 deletions
|
@ -360,11 +360,7 @@ public class Location implements Cloneable {
|
|||
* @throws IllegalArgumentException for differing worlds
|
||||
*/
|
||||
public double distance(Location o) {
|
||||
if (o == null || o.getWorld() != getWorld()) {
|
||||
throw new IllegalArgumentException("Cannot measure distance between worlds or to null");
|
||||
}
|
||||
|
||||
return Math.sqrt(Math.pow(x - o.x, 2) + Math.pow(y - o.y, 2) + Math.pow(z - o.z, 2));
|
||||
return Math.sqrt(distanceSquared(o));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -376,8 +372,10 @@ public class Location implements Cloneable {
|
|||
* @throws IllegalArgumentException for differing worlds
|
||||
*/
|
||||
public double distanceSquared(Location o) {
|
||||
if (o == null || o.getWorld() != getWorld()) {
|
||||
throw new IllegalArgumentException("Cannot measure distance between worlds or to null");
|
||||
if (o == null) {
|
||||
throw new IllegalArgumentException("Cannot measure distance to a null world");
|
||||
} else if (o == null || o.getWorld() != getWorld()) {
|
||||
throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getName() + " and " + o.getWorld().getName());
|
||||
}
|
||||
|
||||
return Math.pow(x - o.x, 2) + Math.pow(y - o.y, 2) + Math.pow(z - o.z, 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue