Package net.neoforged.neoforge.items
Class SlotItemHandler
java.lang.Object
net.minecraft.world.inventory.Slot
net.neoforged.neoforge.items.SlotItemHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Containerprotected final intprivate final IItemHandler -
Constructor Summary
ConstructorsConstructorDescriptionSlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition) -
Method Summary
Modifier and TypeMethodDescriptiongetItem()intintgetMaxStackSize(ItemStack stack) voidinitialize(ItemStack stack) booleanReturn whether this slot's stack can be taken from this slot.booleanCheck if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.voidonQuickCraft(ItemStack oldStackIn, ItemStack newStackIn) if par2 has more items than par1, onCrafting(item,countIncrease) is calledremove(int amount) Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.voidHelper method to put a stack in the slot.Methods inherited from class net.minecraft.world.inventory.Slot
allowModification, checkTakeAchievements, getContainerSlot, getNoItemIcon, getSlotIndex, hasItem, isActive, isFake, isHighlightable, isSameInventory, onQuickCraft, onSwapCraft, onTake, safeInsert, safeInsert, safeTake, setBackground, setByPlayer, setByPlayer, setChanged, tryRemove
-
Field Details
-
emptyInventory
-
itemHandler
-
index
protected final int index
-
-
Constructor Details
-
SlotItemHandler
-
-
Method Details
-
mayPlace
Description copied from class:SlotCheck if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel. -
getItem
-
set
Description copied from class:SlotHelper method to put a stack in the slot. -
initialize
-
onQuickCraft
Description copied from class:Slotif par2 has more items than par1, onCrafting(item,countIncrease) is called- Overrides:
onQuickCraftin classSlot
-
getMaxStackSize
public int getMaxStackSize()- Overrides:
getMaxStackSizein classSlot
-
getMaxStackSize
- Overrides:
getMaxStackSizein classSlot
-
mayPickup
Description copied from class:SlotReturn whether this slot's stack can be taken from this slot. -
remove
Description copied from class:SlotDecrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -
getItemHandler
-