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 Container
protected final int
private final IItemHandler
-
Constructor Summary
ConstructorsConstructorDescriptionSlotItemHandler
(IItemHandler itemHandler, int index, int xPosition, int yPosition) -
Method Summary
Modifier and TypeMethodDescriptiongetItem()
int
int
getMaxStackSize
(ItemStack stack) void
initialize
(ItemStack stack) boolean
Return whether this slot's stack can be taken from this slot.boolean
Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.void
onQuickCraft
(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.void
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, 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:Slot
Check 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:Slot
Helper method to put a stack in the slot. -
initialize
-
onQuickCraft
Description copied from class:Slot
if par2 has more items than par1, onCrafting(item,countIncrease) is called- Overrides:
onQuickCraft
in classSlot
-
getMaxStackSize
public int getMaxStackSize()- Overrides:
getMaxStackSize
in classSlot
-
getMaxStackSize
- Overrides:
getMaxStackSize
in classSlot
-
mayPickup
Description copied from class:Slot
Return whether this slot's stack can be taken from this slot. -
remove
Description copied from class:Slot
Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -
getItemHandler
-