mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
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:
parent
3085b961b8
commit
e03d7ce2ff
@ -10,6 +10,10 @@ function robot.level()
|
||||
return component.robot.level()
|
||||
end
|
||||
|
||||
function robot.name()
|
||||
return component.robot.name()
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- World
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user