public class SlotItemHandler extends Slot
inventory, slotNumber, xPos, yPos
コンストラクタと説明 |
---|
SlotItemHandler(IItemHandler itemHandler,
int index,
int xPosition,
int yPosition) |
修飾子とタイプ | メソッドと説明 |
---|---|
boolean |
canTakeStack(PlayerEntity 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.
|
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.
|
func_225517_c_, getHasStack, getSlotIndex, isEnabled, isSameInventory, onCrafting, onCrafting, onSlotChanged, onSwapCraft, onTake, setBackground
public SlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition)
public boolean isItemValid(@Nonnull ItemStack stack)
Slot
isItemValid
クラス内 Slot
@Nonnull public ItemStack getStack()
Slot
public void putStack(@Nonnull ItemStack stack)
Slot
public void onSlotChange(@Nonnull ItemStack p_75220_1_, @Nonnull ItemStack p_75220_2_)
Slot
onSlotChange
クラス内 Slot
public int getSlotStackLimit()
Slot
getSlotStackLimit
クラス内 Slot
public int getItemStackLimit(@Nonnull ItemStack stack)
getItemStackLimit
クラス内 Slot
public boolean canTakeStack(PlayerEntity playerIn)
Slot
canTakeStack
クラス内 Slot
@Nonnull public ItemStack decrStackSize(int amount)
Slot
decrStackSize
クラス内 Slot
public IItemHandler getItemHandler()