mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
More IPos implementations for IWorld and IPos scripted objects
This commit is contained in:
1 parent
116dc23f2b
commit
a10e427c1c
3 files changed
+13
-8
No files matched your search
@@ -123,7 +123,12 @@ public class ScriptBlockPos implements IPos {
|
||||
return NpcAPI.Instance().getIPos(BlockPos.fromLong(serialized));
|
||||
}
|
||||
|
||||
public double[] normalize() {
|
||||
public IPos normalize() {
|
||||
double d = Math.sqrt((double)(this.blockPos.getX() * this.blockPos.getX() + this.blockPos.getY() * this.blockPos.getY() + this.blockPos.getZ() * this.blockPos.getZ()));
|
||||
return NpcAPI.Instance().getIPos((double)this.getX() / d, (double)this.getY() / d, (double)this.getZ() / d);
|
||||
}
|
||||
|
||||
public double[] normalizeDouble() {
|
||||
double d = Math.sqrt((double)(this.blockPos.getX() * this.blockPos.getX() + this.blockPos.getY() * this.blockPos.getY() + this.blockPos.getZ() * this.blockPos.getZ()));
|
||||
return new double[]{(double)this.getX() / d, (double)this.getY() / d, (double)this.getZ() / d};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user