Re-enabled inventory_controller.getInventorySize(sides.back) for backwards compatibility. Will be removed in 1.5, use robot.inventorySize(). Closes #860.

This commit is contained in:
Florian Nücke 2015-01-27 13:57:33 +01:00
parent 8da121964b
commit a0f11d36b5

View File

@ -76,6 +76,14 @@ object UpgradeInventoryController {
else result(false)
}
// TODO Remove in 1.5
@Callback(doc = """function(side:number):number -- Get the number of slots in the inventory on the specified side of the robot.""")
override def getInventorySize(context: Context, args: Arguments): Array[AnyRef] = {
if (args.optInteger(0, -1) == ForgeDirection.NORTH.ordinal) // sides.back
getInventorySize(context, new ArgumentsImpl(args.toArray.drop(1))) // drop side, just pass slot
else super.getInventorySize(context, args)
}
// TODO Remove in 1.5
@Callback(doc = """function(side:number, slot:number):table -- Get a description of the stack in the the inventory on the specified side of the robot.""")
override def getStackInSlot(context: Context, args: Arguments) = {