public class CombinedInvWrapper extends java.lang.Object implements IItemHandlerModifiable
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
baseIndex |
protected IItemHandlerModifiable[] |
itemHandler |
protected int |
slotCount |
| Constructor and Description |
|---|
CombinedInvWrapper(IItemHandlerModifiable... itemHandler) |
| Modifier and Type | Method and Description |
|---|---|
ItemStack |
extractItem(int slot,
int amount,
boolean simulate)
Extracts an ItemStack from the given slot.
|
protected IItemHandlerModifiable |
getHandlerFromIndex(int index) |
protected int |
getIndexForSlot(int slot) |
protected int |
getSlotFromIndex(int slot,
int index) |
int |
getSlotLimit(int slot)
Retrieves the maximum stack size allowed to exist in the given slot.
|
int |
getSlots()
Returns the number of slots available
|
ItemStack |
getStackInSlot(int slot)
Returns the ItemStack in a given slot.
|
ItemStack |
insertItem(int slot,
ItemStack stack,
boolean simulate)
Inserts an ItemStack into the given slot and return the remainder.
|
void |
setStackInSlot(int slot,
ItemStack stack)
Overrides the stack in the given slot.
|
protected final IItemHandlerModifiable[] itemHandler
protected final int[] baseIndex
protected final int slotCount
public CombinedInvWrapper(IItemHandlerModifiable... itemHandler)
protected int getIndexForSlot(int slot)
protected IItemHandlerModifiable getHandlerFromIndex(int index)
protected int getSlotFromIndex(int slot,
int index)
public void setStackInSlot(int slot,
@Nonnull
ItemStack stack)
IItemHandlerModifiablesetStackInSlot in interface IItemHandlerModifiableslot - Slot to modifystack - ItemStack to set slot to (may be null)public int getSlots()
IItemHandlergetSlots in interface IItemHandler@Nonnull public ItemStack getStackInSlot(int slot)
IItemHandlergetStackInSlot in interface IItemHandlerslot - Slot to query@Nonnull public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
IItemHandlerinsertItem in interface IItemHandlerslot - Slot to insert into.stack - ItemStack to insert.simulate - If true, the insertion is only simulated@Nonnull public ItemStack extractItem(int slot, int amount, boolean simulate)
IItemHandlerextractItem in interface IItemHandlerslot - Slot to extract from.amount - Amount to extract (may be greater than the current stacks max limit)simulate - If true, the extraction is only simulatedpublic int getSlotLimit(int slot)
IItemHandlergetSlotLimit in interface IItemHandlerslot - Slot to query.