mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Magic.
This commit is contained in:
parent
bee560c9ab
commit
5c0a4f7b82
@ -8,6 +8,7 @@ import net.minecraft.entity.player.InventoryPlayer
|
||||
import net.minecraft.item.Item
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagList
|
||||
import li.cil.oc.util.ExtendedInventory._
|
||||
|
||||
class Inventory(val agent: internal.Agent) extends InventoryPlayer(null) {
|
||||
def selectedItemStack = agent.mainInventory.getStackInSlot(agent.selectedSlot)
|
||||
@ -54,8 +55,7 @@ class Inventory(val agent: internal.Agent) extends InventoryPlayer(null) {
|
||||
}
|
||||
|
||||
override def addItemStackToInventory(stack: ItemStack) = {
|
||||
val indices = 0 until getSizeInventory
|
||||
val slots = indices.drop(agent.selectedSlot) ++ indices.take(agent.selectedSlot)
|
||||
val slots = this.indices.drop(agent.selectedSlot) ++ this.indices.take(agent.selectedSlot)
|
||||
InventoryUtils.insertIntoInventory(stack, this, slots = Option(slots))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user