Class SingleItemStackHandler
java.lang.Object
net.minecraft.world.inventory.Slot
com.pixelmonmod.pixelmon.client.gui.machines.slots.SingleItemStackHandler
public class SingleItemStackHandler
extends net.minecraft.world.inventory.Slot
-
Field Summary
Fields inherited from class net.minecraft.world.inventory.Slot
container, x, y -
Constructor Summary
ConstructorsConstructorDescriptionSingleItemStackHandler(net.minecraftforge.items.IItemHandler itemHandler, int index, int xPosition, int yPosition) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackgetItem()Helper fnct to get the stack in the slot.net.minecraftforge.items.IItemHandlerintReturns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)intgetMaxStackSize(net.minecraft.world.item.ItemStack stack) booleanisSameInventory(net.minecraft.world.inventory.Slot other) booleanmayPickup(net.minecraft.world.entity.player.Player playerIn) Return whether this slot's stack can be taken from this slot.booleanmayPlace(net.minecraft.world.item.ItemStack stack) Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.voidonQuickCraft(net.minecraft.world.item.ItemStack p_75220_1_, net.minecraft.world.item.ItemStack p_75220_2_) if par2 has more items than par1, onCrafting(item,countIncrease) is callednet.minecraft.world.item.ItemStackremove(int amount) Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.voidset(net.minecraft.world.item.ItemStack stack) Helper method to put a stack in the slot.Methods inherited from class net.minecraft.world.inventory.Slot
allowModification, checkTakeAchievements, getContainerSlot, getNoItemIcon, getSlotIndex, hasItem, isActive, isHighlightable, onQuickCraft, onSwapCraft, onTake, safeInsert, safeInsert, safeTake, setBackground, setByPlayer, setByPlayer, setChanged, tryRemove
-
Constructor Details
-
SingleItemStackHandler
public SingleItemStackHandler(net.minecraftforge.items.IItemHandler itemHandler, int index, int xPosition, int yPosition)
-
-
Method Details
-
mayPlace
public boolean mayPlace(@Nonnull net.minecraft.world.item.ItemStack stack) Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.- Overrides:
mayPlacein classnet.minecraft.world.inventory.Slot
-
getItem
@Nonnull public net.minecraft.world.item.ItemStack getItem()Helper fnct to get the stack in the slot.- Overrides:
getItemin classnet.minecraft.world.inventory.Slot
-
set
public void set(@Nonnull net.minecraft.world.item.ItemStack stack) Helper method to put a stack in the slot.- Overrides:
setin classnet.minecraft.world.inventory.Slot
-
onQuickCraft
public void onQuickCraft(@Nonnull net.minecraft.world.item.ItemStack p_75220_1_, @Nonnull net.minecraft.world.item.ItemStack p_75220_2_) if par2 has more items than par1, onCrafting(item,countIncrease) is called- Overrides:
onQuickCraftin classnet.minecraft.world.inventory.Slot
-
getMaxStackSize
public int getMaxStackSize()Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)- Overrides:
getMaxStackSizein classnet.minecraft.world.inventory.Slot
-
getMaxStackSize
public int getMaxStackSize(@Nonnull net.minecraft.world.item.ItemStack stack) - Overrides:
getMaxStackSizein classnet.minecraft.world.inventory.Slot
-
mayPickup
public boolean mayPickup(net.minecraft.world.entity.player.Player playerIn) Return whether this slot's stack can be taken from this slot.- Overrides:
mayPickupin classnet.minecraft.world.inventory.Slot
-
remove
@Nonnull public net.minecraft.world.item.ItemStack remove(int amount) Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack.- Overrides:
removein classnet.minecraft.world.inventory.Slot
-
getItemHandler
public net.minecraftforge.items.IItemHandler getItemHandler() -
isSameInventory
public boolean isSameInventory(net.minecraft.world.inventory.Slot other) - Overrides:
isSameInventoryin classnet.minecraft.world.inventory.Slot
-