mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Added alternate distanceTo function using three double values instead of an IPos object.
This commit is contained in:
1 parent
1df7819931
commit
d638c98d81
2 files changed
+8
-1
No files matched your search
@@ -135,6 +135,13 @@ public class ScriptBlockPos implements IPos {
|
||||
return Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
|
||||
}
|
||||
|
||||
public double distanceTo(double x, double y, double z) {
|
||||
double d0 = (double)(this.getX() - x);
|
||||
double d1 = (double)(this.getY() - y);
|
||||
double d2 = (double)(this.getZ() - z);
|
||||
return Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
|
||||
}
|
||||
|
||||
public BlockPos getMCPos() {
|
||||
return this.blockPos;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user