mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-12 02:13:42 -04:00
Merged quality_assurance into showlootbox
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user