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, setBackgroundName
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 getSlotStackLimit()
getSlotStackLimit
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
public IItemHandler getItemHandler()
public boolean isSameInventory(Slot other)
Slot
isSameInventory
in class Slot