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, setBackgroundpublic SlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition)
public boolean isItemValid(@Nonnull
ItemStack stack)
SlotisItemValid クラス内 Slot@Nonnull public ItemStack getStack()
Slotpublic void putStack(@Nonnull
ItemStack stack)
Slotpublic void onSlotChange(@Nonnull
ItemStack p_75220_1_,
@Nonnull
ItemStack p_75220_2_)
SlotonSlotChange クラス内 Slotpublic int getSlotStackLimit()
SlotgetSlotStackLimit クラス内 Slotpublic int getItemStackLimit(@Nonnull
ItemStack stack)
getItemStackLimit クラス内 Slotpublic boolean canTakeStack(PlayerEntity playerIn)
SlotcanTakeStack クラス内 Slot@Nonnull public ItemStack decrStackSize(int amount)
SlotdecrStackSize クラス内 Slotpublic IItemHandler getItemHandler()