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
IItemHandler
s
like ComponentItemHandler
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItemHandlerCopySlot
(IItemHandler itemHandler, int index, int xPosition, int yPosition) ItemHandlerCopySlot
(SlotItemHandler slotItemHandler) -
Method Summary
Modifier and TypeMethodDescriptionint
int
getMaxStackSize
(ItemStack stack) protected ItemStack
Gets the itemstack from the storage.boolean
isSameInventory
(Slot other) Checks if the other slot is in the same inventory, by comparing the inventory reference.boolean
boolean
void
onQuickCraft
(ItemStack oldStackIn, ItemStack newStackIn) protected void
setStackCopy
(ItemStack stack) Sets the itemstack from the storage.Methods inherited from class net.neoforged.neoforge.items.StackCopySlot
getItem, remove, set, setChanged
Methods 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
-
getStackCopy
Description copied from class:StackCopySlot
Gets the itemstack from the storage.- Specified by:
getStackCopy
in classStackCopySlot
- Returns:
- the stack in this slot
-
setStackCopy
Description copied from class:StackCopySlot
Sets the itemstack from the storage.- Specified by:
setStackCopy
in classStackCopySlot
- Parameters:
stack
- the stack to put into this slot
-
onQuickCraft
- Overrides:
onQuickCraft
in classSlot
-
getMaxStackSize
public int getMaxStackSize()- Overrides:
getMaxStackSize
in classSlot
-
getMaxStackSize
- Overrides:
getMaxStackSize
in classSlot
-
mayPickup
-
isSameInventory
Description copied from class:Slot
Checks if the other slot is in the same inventory, by comparing the inventory reference.- Overrides:
isSameInventory
in classSlot
- Parameters:
other
-- Returns:
- true if the other slot is in the same inventory
-
getItemHandler
-