类 StackCopySlot
java.lang.Object
net.minecraft.world.inventory.Slot
net.neoforged.neoforge.items.StackCopySlot
- 直接已知子类:
ItemHandlerCopySlot
Slot to handle immutable itemstack storages (Ex:
ComponentItemHandler
).
For an implementation for use with an IItemHandler
see ItemHandlerCopySlot
.
Vanilla MC code modifies the stack returned by `getStack()` directly, but it
calls setChanged()
when that happens, so we just cache the returned stack,
and set it when setChanged()
is called.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
从类继承的方法 net.minecraft.world.inventory.Slot
allowModification, checkTakeAchievements, getContainerSlot, getMaxStackSize, getMaxStackSize, getNoItemIcon, getSlotIndex, hasItem, isActive, isFake, isHighlightable, isSameInventory, mayPickup, mayPlace, onQuickCraft, onQuickCraft, onSwapCraft, onTake, safeInsert, safeInsert, safeTake, setBackground, setByPlayer, setByPlayer, tryRemove
-
字段详细资料
-
emptyInventory
-
cachedReturnedStack
-
-
构造器详细资料
-
StackCopySlot
public StackCopySlot(int x, int y)
-
-
方法详细资料
-
getStackCopy
Gets the itemstack from the storage.- 返回:
- the stack in this slot
-
setStackCopy
Sets the itemstack from the storage.- 参数:
stack
- the stack to put into this slot
-
getItem
-
set
-
setChanged
public final void setChanged()- 覆盖:
setChanged
在类中Slot
-
remove
-