public class SlotItemHandler extends Slot
Modifier and Type | Field and Description |
---|---|
IItemHandler |
itemHandler |
backgroundLocation, backgroundMap, backgroundName, inventory, slotNumber, xDisplayPosition, yDisplayPosition
Constructor and Description |
---|
SlotItemHandler(IItemHandler itemHandler,
int index,
int xPosition,
int yPosition) |
Modifier and Type | Method and Description |
---|---|
boolean |
canTakeStack(EntityPlayer playerIn)
Return whether this slot's stack can be taken from this slot.
|
ItemStack |
decrStackSize(int amount)
Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.
|
int |
getItemStackLimit(ItemStack stack) |
ItemStack |
getStack()
Helper fnct to get the stack in the slot.
|
boolean |
isItemValid(ItemStack stack)
Check if the stack is a valid item for this slot.
|
void |
onSlotChange(ItemStack p_75220_1_,
ItemStack p_75220_2_)
if par2 has more items than par1, onCrafting(item,countIncrease) is called
|
void |
putStack(ItemStack stack)
Helper method to put a stack in the slot.
|
canBeHovered, getBackgroundLocation, getBackgroundMap, getBackgroundSprite, getHasStack, getSlotIndex, getSlotStackLimit, getSlotTexture, isHere, onCrafting, onCrafting, onPickupFromSlot, onSlotChanged, setBackgroundLocation, setBackgroundName
public final IItemHandler itemHandler
public SlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition)
public boolean isItemValid(ItemStack stack)
isItemValid
in class Slot
public ItemStack getStack()
public void putStack(ItemStack stack)
public void onSlotChange(ItemStack p_75220_1_, ItemStack p_75220_2_)
onSlotChange
in class Slot
public int getItemStackLimit(ItemStack stack)
getItemStackLimit
in class Slot
public boolean canTakeStack(EntityPlayer playerIn)
canTakeStack
in class Slot
public ItemStack decrStackSize(int amount)
decrStackSize
in class Slot