@LuaCallable( returnTypes = {LuaType.NUMBER, LuaType.NUMBER, LuaType.NUMBER}, description = "Get turtle position") public IMultiReturn getPosition() { EntityMagnet magnet = getMagnet(); Vec3 rotated = getRelativeDistance(magnet); return OpenPeripheralAPI.wrap(rotated.xCoord, rotated.yCoord, rotated.zCoord); }
@Alias("distance") @LuaCallable(returnTypes = {LuaType.NUMBER, LuaType.NUMBER, LuaType.NUMBER}) public IMultiReturn getDistanceToTarget() { EntityMagnet magnet = getMagnet(); Vec3 current = getRelativeDistance(magnet); Vec3 target = magnetOwner.target; return OpenPeripheralAPI.wrap( current.xCoord - target.xCoord, current.yCoord - target.yCoord, current.zCoord - target.zCoord); }