mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-25 14:05:39 -04:00
Add Robot API to inspect its upgrade containers
This commit is contained in:
parent
e6a026c178
commit
30aa902620
@ -107,6 +107,22 @@ object UpgradeInventoryController {
|
||||
}
|
||||
else result(false)
|
||||
}
|
||||
|
||||
@Callback(doc = """function(slot:number):string -- get upgrade container type at the given slot.""")
|
||||
def getUpgradeContainerType(context: Context, args: Arguments): Array[AnyRef] = {
|
||||
val slot = args.checkInteger(0)
|
||||
if (!host.isContainerSlot(slot))
|
||||
return result("None")
|
||||
result(host.containerSlotType(slot))
|
||||
}
|
||||
|
||||
@Callback(doc = """function(slot:number):number -- get upgrade container tier at the given slot.""")
|
||||
def getUpgradeContainerTier(context: Context, args: Arguments): Array[AnyRef] = {
|
||||
val slot = args.checkInteger(0)
|
||||
if (!host.isContainerSlot(slot))
|
||||
return result(0)
|
||||
result(host.containerSlotTier(slot))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user