mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Added backwards compatibility to inventory_controller.getStackInSlot, closes #803.
This commit is contained in:
parent
bce4a60394
commit
61b26e17cb
@ -9,6 +9,7 @@ import li.cil.oc.api.network._
|
|||||||
import li.cil.oc.api.prefab
|
import li.cil.oc.api.prefab
|
||||||
import li.cil.oc.common.entity
|
import li.cil.oc.common.entity
|
||||||
import li.cil.oc.common.tileentity
|
import li.cil.oc.common.tileentity
|
||||||
|
import li.cil.oc.server.machine.ArgumentsImpl
|
||||||
import li.cil.oc.util.BlockPosition
|
import li.cil.oc.util.BlockPosition
|
||||||
import li.cil.oc.util.ExtendedArguments._
|
import li.cil.oc.util.ExtendedArguments._
|
||||||
import net.minecraft.entity.Entity
|
import net.minecraft.entity.Entity
|
||||||
@ -74,6 +75,14 @@ object UpgradeInventoryController {
|
|||||||
}
|
}
|
||||||
else result(false)
|
else result(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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) = {
|
||||||
|
if (args.optInteger(0, -1) == ForgeDirection.NORTH.ordinal) // sides.back
|
||||||
|
getStackInInternalSlot(context, new ArgumentsImpl(args.toArray.drop(1))) // drop side, just pass slot
|
||||||
|
else super.getStackInSlot(context, args) // normal call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user