public class SingleItemStackHandler
extends net.minecraft.inventory.container.Slot
Constructor and Description |
---|
SingleItemStackHandler(net.minecraftforge.items.IItemHandler itemHandler,
int index,
int xPosition,
int yPosition) |
Modifier and Type | Method and Description |
---|---|
net.minecraft.item.ItemStack |
getItem()
Helper fnct to get the stack in the slot.
|
net.minecraftforge.items.IItemHandler |
getItemHandler() |
int |
getMaxStackSize()
Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
of armor slots)
|
int |
getMaxStackSize(net.minecraft.item.ItemStack stack) |
boolean |
isSameInventory(net.minecraft.inventory.container.Slot other) |
boolean |
mayPickup(net.minecraft.entity.player.PlayerEntity playerIn)
Return whether this slot's stack can be taken from this slot.
|
boolean |
mayPlace(net.minecraft.item.ItemStack stack)
Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
|
void |
onQuickCraft(net.minecraft.item.ItemStack p_75220_1_,
net.minecraft.item.ItemStack p_75220_2_)
if par2 has more items than par1, onCrafting(item,countIncrease) is called
|
net.minecraft.item.ItemStack |
remove(int amount)
Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.
|
void |
set(net.minecraft.item.ItemStack stack)
Helper method to put a stack in the slot.
|
public SingleItemStackHandler(net.minecraftforge.items.IItemHandler itemHandler, int index, int xPosition, int yPosition)
public boolean mayPlace(@Nonnull net.minecraft.item.ItemStack stack)
mayPlace
in class net.minecraft.inventory.container.Slot
@Nonnull public net.minecraft.item.ItemStack getItem()
getItem
in class net.minecraft.inventory.container.Slot
public void set(@Nonnull net.minecraft.item.ItemStack stack)
set
in class net.minecraft.inventory.container.Slot
public void onQuickCraft(@Nonnull net.minecraft.item.ItemStack p_75220_1_, @Nonnull net.minecraft.item.ItemStack p_75220_2_)
onQuickCraft
in class net.minecraft.inventory.container.Slot
public int getMaxStackSize()
getMaxStackSize
in class net.minecraft.inventory.container.Slot
public int getMaxStackSize(@Nonnull net.minecraft.item.ItemStack stack)
getMaxStackSize
in class net.minecraft.inventory.container.Slot
public boolean mayPickup(net.minecraft.entity.player.PlayerEntity playerIn)
mayPickup
in class net.minecraft.inventory.container.Slot
@Nonnull public net.minecraft.item.ItemStack remove(int amount)
remove
in class net.minecraft.inventory.container.Slot
public net.minecraftforge.items.IItemHandler getItemHandler()
public boolean isSameInventory(net.minecraft.inventory.container.Slot other)
isSameInventory
in class net.minecraft.inventory.container.Slot