diff --git a/src/main/java/appeng/util/inv/ItemHandlerIterator.java b/src/main/java/appeng/util/inv/ItemHandlerIterator.java index 6994cbbb4..7b4f6acf1 100644 --- a/src/main/java/appeng/util/inv/ItemHandlerIterator.java +++ b/src/main/java/appeng/util/inv/ItemHandlerIterator.java @@ -55,6 +55,8 @@ class ItemHandlerIterator implements Iterator this.itemSlot.setExtractable( !this.itemHandler.extractItem( this.slot, 1, true ).isEmpty() ); this.itemSlot.setItemStack( this.itemHandler.getStackInSlot( this.slot ) ); this.itemSlot.setSlot( this.slot ); + this.itemSlot.setSlotLimit( this.itemHandler.getSlotLimit( this.slot ) ); + this.itemSlot.setItemHandler( this.itemHandler ); this.slot++; return this.itemSlot; } diff --git a/src/main/java/appeng/util/inv/ItemSlot.java b/src/main/java/appeng/util/inv/ItemSlot.java index 795a6336e..560cfe7d3 100644 --- a/src/main/java/appeng/util/inv/ItemSlot.java +++ b/src/main/java/appeng/util/inv/ItemSlot.java @@ -23,6 +23,7 @@ import net.minecraft.item.ItemStack; import appeng.api.storage.data.IAEItemStack; import appeng.util.item.AEItemStack; +import net.minecraftforge.items.IItemHandler; public class ItemSlot @@ -34,6 +35,25 @@ public class ItemSlot private IAEItemStack aeItemStack; private ItemStack itemStack; + public void setItemHandler( IItemHandler itemHandler ) + { + this.itemHandler = itemHandler; + } + + private IItemHandler itemHandler; + + public int getSlotLimit() + { + return slotLimit; + } + + public void setSlotLimit( int slotLimit ) + { + this.slotLimit = slotLimit; + } + + private int slotLimit; + public ItemStack getItemStack() { return this.itemStack @@ -77,4 +97,19 @@ public class ItemSlot { this.slot = slot; } + + public ItemSlot copy() + { + ItemSlot copy = new ItemSlot(); + copy.setSlot( this.slot ); + copy.setSlotLimit( this.slotLimit ); + copy.setItemStack( this.getItemStack() ); + copy.setExtractable( this.isExtractable ); + copy.setItemHandler( this.itemHandler ); + return copy; + } + + public ItemStack insertItem( ItemStack sourceItemStack){ + return this.itemHandler.insertItem( this.slot, sourceItemStack , true ); + } }