public class RangedWrapper extends java.lang.Object implements IItemHandlerModifiable
Constructor and Description |
---|
RangedWrapper(IItemHandlerModifiable compose,
int minSlot,
int maxSlotExclusive) |
Modifier and Type | Method and Description |
---|---|
ItemStack |
extractItem(int slot,
int amount,
boolean simulate)
Extracts an ItemStack from the given slot.
|
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.
|
public RangedWrapper(IItemHandlerModifiable compose, int minSlot, int maxSlotExclusive)
public int getSlots()
IItemHandler
getSlots
in interface IItemHandler
@Nonnull public ItemStack getStackInSlot(int slot)
IItemHandler
getStackInSlot
in interface IItemHandler
slot
- Slot to query@Nonnull public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
IItemHandler
insertItem
in interface IItemHandler
slot
- 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)
IItemHandler
extractItem
in interface IItemHandler
slot
- 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 void setStackInSlot(int slot, @Nonnull ItemStack stack)
IItemHandlerModifiable
setStackInSlot
in interface IItemHandlerModifiable
slot
- Slot to modifystack
- ItemStack to set slot to (may be null)public int getSlotLimit(int slot)
IItemHandler
getSlotLimit
in interface IItemHandler
slot
- Slot to query.