Package net.neoforged.neoforge.items
Class ItemHandlerCopySlot
java.lang.Object
net.minecraft.world.inventory.Slot
net.neoforged.neoforge.items.StackCopySlot
net.neoforged.neoforge.items.ItemHandlerCopySlot
Slot class that can be used with immutable
IItemHandlers
like ComponentItemHandler.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItemHandlerCopySlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) ItemHandlerCopySlot(SlotItemHandler slotItemHandler) -
Method Summary
Modifier and TypeMethodDescriptionintintgetMaxStackSize(ItemStack stack) protected ItemStackGets the itemstack from the storage.booleanisSameInventory(Slot other) Checks if the other slot is in the same inventory, by comparing the inventory reference.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 calledprotected voidsetStackCopy(ItemStack stack) Sets the itemstack from the storage.Methods inherited from class net.neoforged.neoforge.items.StackCopySlot
getItem, remove, set, setChangedMethods inherited from class net.minecraft.world.inventory.Slot
allowModification, checkTakeAchievements, getContainerSlot, getNoItemIcon, getSlotIndex, hasItem, isActive, isFake, isHighlightable, onQuickCraft, onSwapCraft, onTake, safeInsert, safeInsert, safeTake, setBackground, setByPlayer, setByPlayer, tryRemove
-
Field Details
-
slotItemHandler
-
-
Constructor Details
-
ItemHandlerCopySlot
-
ItemHandlerCopySlot
-
-
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. -
getStackCopy
Description copied from class:StackCopySlotGets the itemstack from the storage.- Specified by:
getStackCopyin classStackCopySlot- Returns:
- the stack in this slot
-
setStackCopy
Description copied from class:StackCopySlotSets the itemstack from the storage.- Specified by:
setStackCopyin classStackCopySlot- Parameters:
stack- the stack to put into this slot
-
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. -
isSameInventory
Description copied from class:SlotChecks if the other slot is in the same inventory, by comparing the inventory reference.- Overrides:
isSameInventoryin classSlot- Parameters:
other-- Returns:
- true if the other slot is in the same inventory
-
getItemHandler
-