public class SlotItemHandler extends Slot
backgroundLocation, backgroundMap, backgroundName, inventory, slotNumber, xPos, yPos| 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.
|
IItemHandler |
getItemHandler() |
int |
getItemStackLimit(ItemStack stack) |
int |
getSlotStackLimit()
Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
of armor slots)
|
ItemStack |
getStack()
Helper fnct to get the stack in the slot.
|
boolean |
isItemValid(ItemStack stack)
Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
|
boolean |
isSameInventory(Slot other)
Checks if the other slot is in the same inventory, by comparing the inventory reference.
|
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, getSlotTexture, isHere, onCrafting, onCrafting, onSlotChanged, onSwapCraft, onTake, setBackgroundLocation, setBackgroundNamepublic 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 getSlotStackLimit()
getSlotStackLimit 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 Slotpublic IItemHandler getItemHandler()
public boolean isSameInventory(Slot other)
SlotisSameInventory in class Slot