public class VanillaDoubleChestItemHandler extends java.lang.ref.WeakReference<TileEntityChest> implements IItemHandlerModifiable
Modifier and Type | Field and Description |
---|---|
static VanillaDoubleChestItemHandler |
NO_ADJACENT_CHESTS_INSTANCE |
Constructor and Description |
---|
VanillaDoubleChestItemHandler(TileEntityChest mainChest,
TileEntityChest other,
boolean mainChestIsUpper) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
ItemStack |
extractItem(int slot,
int amount,
boolean simulate)
Extracts an ItemStack from the given slot.
|
static VanillaDoubleChestItemHandler |
get(TileEntityChest chest) |
TileEntityChest |
getChest(boolean accessingUpper) |
int |
getSlots()
Returns the number of slots available
|
ItemStack |
getStackInSlot(int slot)
Returns the ItemStack in a given slot.
|
int |
hashCode() |
ItemStack |
insertItem(int slot,
ItemStack stack,
boolean simulate)
Inserts an ItemStack into the given slot and return the remainder.
|
boolean |
needsRefresh() |
void |
setStackInSlot(int slot,
ItemStack stack)
Overrides the stack in the given slot.
|
public static final VanillaDoubleChestItemHandler NO_ADJACENT_CHESTS_INSTANCE
public VanillaDoubleChestItemHandler(TileEntityChest mainChest, TileEntityChest other, boolean mainChestIsUpper)
public static VanillaDoubleChestItemHandler get(TileEntityChest chest)
public TileEntityChest getChest(boolean accessingUpper)
public int getSlots()
IItemHandler
getSlots
in interface IItemHandler
public ItemStack getStackInSlot(int slot)
IItemHandler
getStackInSlot
in interface IItemHandler
slot
- Slot to querypublic void setStackInSlot(int slot, ItemStack stack)
IItemHandlerModifiable
setStackInSlot
in interface IItemHandlerModifiable
slot
- Slot to modifystack
- ItemStack to set slot to (may be null)public ItemStack insertItem(int slot, 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 simulatedpublic 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 boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean needsRefresh()