From 1f084dadb97738f97e9bccce3b367847c86d6170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 10 Jan 2014 21:23:57 +0100 Subject: [PATCH] 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 --- li/cil/oc/server/component/UpgradeNavigation.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/li/cil/oc/server/component/UpgradeNavigation.scala b/li/cil/oc/server/component/UpgradeNavigation.scala index d390a1e92..59b59034e 100644 --- a/li/cil/oc/server/component/UpgradeNavigation.scala +++ b/li/cil/oc/server/component/UpgradeNavigation.scala @@ -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") }