Merged quality_assurance into showlootbox

This commit is contained in:
Mads Boddum
2016-11-01 05:04:38 +01:00
parent 169bd0a9ec
commit 2aaea95665
150 changed files with 25194 additions and 18490 deletions
+9 -1
View File
@@ -107,6 +107,10 @@ public class Location implements Encodable, Persistable {
return square(getX()-x) + square(getY()-y) + square(getZ()-z) <= square(radius);
}
public boolean isWithinFlatDistance(Location l, double radius) {
return isWithinFlatDistance(l.point, radius);
}
public boolean isWithinFlatDistance(Point3D target, double radius){
return square(getX() - target.getX()) + square(getZ() - target.getZ()) <= square(radius);
}
@@ -313,6 +317,10 @@ public class Location implements Encodable, Persistable {
* @return the distance between {@code this} and destination, which is ALWAYS positive.
*/
public double distanceTo(Location destination) {
return Math.sqrt(square(destination.getX() - getX()) + square(destination.getY() - getY()) + square(destination.getZ() - getZ()));
return distanceTo(destination.getX(), destination.getY(), destination.getZ());
}
public double distanceTo(double dstX, double dstY, double dstZ) {
return Math.sqrt(square(dstX - getX()) + square(dstY - getY()) + square(dstZ - getZ()));
}
}