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, setBackgroundNamepublic final IItemHandler itemHandler
public SlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition)
public boolean isItemValid(ItemStack stack)
isItemValid in class Slotpublic ItemStack getStack()
public void putStack(ItemStack stack)
public void onSlotChange(ItemStack p_75220_1_, ItemStack p_75220_2_)
onSlotChange in class Slotpublic int getItemStackLimit(ItemStack stack)
getItemStackLimit in class Slotpublic boolean canTakeStack(EntityPlayer playerIn)
canTakeStack in class Slotpublic ItemStack decrStackSize(int amount)
decrStackSize in class Slot