mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 18:55:03 -04:00
fixed the order of the coordinates navigation.getPosition returns, so that they're in Minecraft order: x, y, z and not x, z, y as they currently are
This commit is contained in:
parent
0cd901e7ff
commit
1f084dadb9
@ -15,13 +15,13 @@ class UpgradeNavigation(val owner: MCTileEntity, val xCenter: Int, val zCenter:
|
||||
@LuaCallback("getPosition")
|
||||
def getPosition(context: RobotContext, args: Arguments): Array[AnyRef] = {
|
||||
val x = owner.xCoord
|
||||
val z = owner.zCoord
|
||||
val y = owner.yCoord
|
||||
val z = owner.zCoord
|
||||
val relativeX = x - xCenter
|
||||
val relativeY = z - zCenter
|
||||
val relativeZ = z - zCenter
|
||||
|
||||
if (math.abs(relativeX) <= size / 2 && math.abs(relativeY) <= size / 2)
|
||||
result(relativeX, relativeY, y)
|
||||
if (math.abs(relativeX) <= size / 2 && math.abs(relativeZ) <= size / 2)
|
||||
result(relativeX, y, relativeZ)
|
||||
else
|
||||
result(Unit, "out of range")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user