added getter for robot's name to the robot api

larger screens render further than smaller screens now (the max render distance setting applies to 1x1 screens)
This commit is contained in:
Florian Nücke 2014-03-30 17:00:46 +02:00
parent 3085b961b8
commit e03d7ce2ff
3 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,10 @@ function robot.level()
return component.robot.level()
end
function robot.name()
return component.robot.name()
end
-------------------------------------------------------------------------------
-- World

View File

@ -45,7 +45,7 @@ object ScreenRenderer extends TileEntitySpecialRenderer with Callable[Int] with
return
}
val distance = playerDistanceSq()
val distance = playerDistanceSq() / math.min(screen.width, screen.height)
if (distance > maxRenderDistanceSq) {
return
}

View File

@ -54,6 +54,9 @@ class Robot(val robot: tileentity.Robot) extends ManagedComponent {
result(robot.level + xpProgress / xpNeeded)
}
@Callback
def name(context: Context, args: Arguments): Array[AnyRef] = result(robot.name)
// ----------------------------------------------------------------------- //
@Callback