类 ItemContainerContents
java.lang.Object
net.minecraft.world.item.component.ItemContainerContents
- 所有已实现的接口:
TooltipProvider
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final com.mojang.serialization.Codec
<ItemContainerContents> static final ItemContainerContents
private final int
private final NonNullList
<ItemStack> private static final int
private static final int
static final StreamCodec
<RegistryFriendlyByteBuf, ItemContainerContents> -
构造器概要
构造器限定符构造器说明private
ItemContainerContents
(int p_331689_) private
ItemContainerContents
(List<ItemStack> p_331046_) private
ItemContainerContents
(NonNullList<ItemStack> p_332193_) -
方法概要
修饰符和类型方法说明void
addToTooltip
(Item.TooltipContext p_400001_, Consumer<Component> p_399797_, TooltipFlag p_399639_, DataComponentGetter p_399821_) private List
<ItemContainerContents.Slot> asSlots()
void
copyInto
(NonNullList<ItemStack> p_330513_) copyOne()
boolean
private static int
findLastNonEmptySlot
(List<ItemStack> p_340916_) static ItemContainerContents
private static ItemContainerContents
fromSlots
(List<ItemContainerContents.Slot> p_331424_) int
getSlots()
Neo: 返回 the number of slots in this container。getStackInSlot
(int slot) Neo: Gets a copy of the stack at a particular slot.int
hashCode()
stream()
private void
validateSlotIndex
(int slot) Neo: ThrowsUnsupportedOperationException
if the provided slot index is invalid.
-
字段详细资料
-
NO_SLOT
private static final int NO_SLOT- 另请参阅:
-
MAX_SIZE
private static final int MAX_SIZE- 另请参阅:
-
EMPTY
-
CODEC
-
STREAM_CODEC
-
items
-
hashCode
private final int hashCode
-
-
构造器详细资料
-
ItemContainerContents
-
ItemContainerContents
private ItemContainerContents(int p_331689_) -
ItemContainerContents
-
-
方法详细资料
-
fromSlots
-
fromItems
-
findLastNonEmptySlot
-
asSlots
-
copyInto
-
copyOne
-
stream
-
nonEmptyStream
-
nonEmptyItems
-
nonEmptyItemsCopy
-
equals
-
hashCode
public int hashCode() -
addToTooltip
public void addToTooltip(Item.TooltipContext p_400001_, Consumer<Component> p_399797_, TooltipFlag p_399639_, DataComponentGetter p_399821_) - 指定者:
addToTooltip
在接口中TooltipProvider
-
getSlots
public int getSlots()Neo: 返回 the number of slots in this container。- 返回:
- the number of slots in this container
-
getStackInSlot
Neo: Gets a copy of the stack at a particular slot.- 参数:
slot
- The slot to check. Must be within [0,getSlots()
]- 返回:
- A copy of the stack in that slot
- 抛出:
UnsupportedOperationException
- if the provided slot index is out-of-bounds.
-
validateSlotIndex
private void validateSlotIndex(int slot) Neo: ThrowsUnsupportedOperationException
if the provided slot index is invalid.
-