Package net.minecraft.component.type
Class ContainerComponent
java.lang.Object
net.minecraft.component.type.ContainerComponent
A component that stores a list of item stacks.
- Mappings:
Namespace Name named net/minecraft/component/type/ContainerComponent
intermediary net/minecraft/class_9288
official dag
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
static final com.mojang.serialization.Codec
<ContainerComponent> static final ContainerComponent
An empty container component.private final int
private static final int
static final PacketCodec
<RegistryByteBuf, ContainerComponent> private final DefaultedList
<ItemStack> -
Constructor Summary
ModifierConstructorDescriptionprivate
ContainerComponent
(int size) private
ContainerComponent
(List<ItemStack> stacks) private
ContainerComponent
(DefaultedList<ItemStack> stacks) -
Method Summary
Modifier and TypeMethodDescriptionprivate List
<ContainerComponent.Slot> Returns a copy of the first contained stack in this component.void
copyTo
(DefaultedList<ItemStack> stacks) Copies the contents of this component to a list of item stacks.boolean
private static int
findLastNonEmptyIndex
(List<ItemStack> stacks) private static ContainerComponent
fromSlots
(List<ContainerComponent.Slot> slots) static ContainerComponent
fromStacks
(List<ItemStack> stacks) Creates a container component from a list of item stacks.int
hashCode()
Returns an iterable over this component's non-empty item stacks.Returns an iterable over copies of this component's non-empty item stacks.stream()
Returns a stream over copies of this component's stored item stacks.Returns a stream over copies of this component's non-empty item stacks.
-
Field Details
-
ALL_SLOTS_EMPTY
private static final int ALL_SLOTS_EMPTY- See Also:
- Mappings:
Namespace Name Mixin selector named ALL_SLOTS_EMPTY
Lnet/minecraft/component/type/ContainerComponent;ALL_SLOTS_EMPTY:I
intermediary field_51410
Lnet/minecraft/class_9288;field_51410:I
official d
Ldag;d:I
-
MAX_SLOTS
private static final int MAX_SLOTS- See Also:
- Mappings:
Namespace Name Mixin selector named MAX_SLOTS
Lnet/minecraft/component/type/ContainerComponent;MAX_SLOTS:I
intermediary field_49337
Lnet/minecraft/class_9288;field_49337:I
official e
Ldag;e:I
-
DEFAULT
An empty container component.- Mappings:
Namespace Name Mixin selector named DEFAULT
Lnet/minecraft/component/type/ContainerComponent;DEFAULT:Lnet/minecraft/component/type/ContainerComponent;
intermediary field_49334
Lnet/minecraft/class_9288;field_49334:Lnet/minecraft/class_9288;
official a
Ldag;a:Ldag;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/component/type/ContainerComponent;CODEC:Lcom/mojang/serialization/Codec;
intermediary field_49335
Lnet/minecraft/class_9288;field_49335:Lcom/mojang/serialization/Codec;
official b
Ldag;b:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODEC
Lnet/minecraft/component/type/ContainerComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
intermediary field_49336
Lnet/minecraft/class_9288;field_49336:Lnet/minecraft/class_9139;
official c
Ldag;c:Lzt;
-
stacks
- Mappings:
Namespace Name Mixin selector named stacks
Lnet/minecraft/component/type/ContainerComponent;stacks:Lnet/minecraft/util/collection/DefaultedList;
intermediary field_49338
Lnet/minecraft/class_9288;field_49338:Lnet/minecraft/class_2371;
official f
Ldag;f:Ljz;
-
hashCode
private final int hashCode- Mappings:
Namespace Name Mixin selector named hashCode
Lnet/minecraft/component/type/ContainerComponent;hashCode:I
intermediary field_51511
Lnet/minecraft/class_9288;field_51511:I
official g
Ldag;g:I
-
-
Constructor Details
-
ContainerComponent
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/component/type/ContainerComponent;<init>(Lnet/minecraft/util/collection/DefaultedList;)V
intermediary <init>
Lnet/minecraft/class_9288;<init>(Lnet/minecraft/class_2371;)V
official <init>
Ldag;<init>(Ljz;)V
-
ContainerComponent
private ContainerComponent(int size) - Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/component/type/ContainerComponent;<init>(I)V
intermediary <init>
Lnet/minecraft/class_9288;<init>(I)V
official <init>
Ldag;<init>(I)V
-
ContainerComponent
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/component/type/ContainerComponent;<init>(Ljava/util/List;)V
intermediary <init>
Lnet/minecraft/class_9288;<init>(Ljava/util/List;)V
official <init>
Ldag;<init>(Ljava/util/List;)V
-
-
Method Details
-
fromSlots
- Mappings:
Namespace Name Mixin selector named fromSlots
Lnet/minecraft/component/type/ContainerComponent;fromSlots(Ljava/util/List;)Lnet/minecraft/component/type/ContainerComponent;
intermediary method_57496
Lnet/minecraft/class_9288;method_57496(Ljava/util/List;)Lnet/minecraft/class_9288;
official b
Ldag;b(Ljava/util/List;)Ldag;
-
fromStacks
Creates a container component from a list of item stacks. The stacks are copied into the component, which will contain copies of all stacks up to the last non-empty stack.- Parameters:
stacks
- the list of stacks to copy- Returns:
- the created component
- Mappings:
Namespace Name Mixin selector named fromStacks
Lnet/minecraft/component/type/ContainerComponent;fromStacks(Ljava/util/List;)Lnet/minecraft/component/type/ContainerComponent;
intermediary method_57493
Lnet/minecraft/class_9288;method_57493(Ljava/util/List;)Lnet/minecraft/class_9288;
official a
Ldag;a(Ljava/util/List;)Ldag;
-
findLastNonEmptyIndex
- Mappings:
Namespace Name Mixin selector named findLastNonEmptyIndex
Lnet/minecraft/component/type/ContainerComponent;findLastNonEmptyIndex(Ljava/util/List;)I
intermediary method_59713
Lnet/minecraft/class_9288;method_59713(Ljava/util/List;)I
official c
Ldag;c(Ljava/util/List;)I
-
collectSlots
- Mappings:
Namespace Name Mixin selector named collectSlots
Lnet/minecraft/component/type/ContainerComponent;collectSlots()Ljava/util/List;
intermediary method_57494
Lnet/minecraft/class_9288;method_57494()Ljava/util/List;
official f
Ldag;f()Ljava/util/List;
-
copyTo
Copies the contents of this component to a list of item stacks.If the list has a larger size than this component, the remaining slots will be filled with empty stacks.
- Parameters:
stacks
- the target list of item stacks- Mappings:
Namespace Name Mixin selector named copyTo
Lnet/minecraft/component/type/ContainerComponent;copyTo(Lnet/minecraft/util/collection/DefaultedList;)V
intermediary method_57492
Lnet/minecraft/class_9288;method_57492(Lnet/minecraft/class_2371;)V
official a
Ldag;a(Ljz;)V
-
copyFirstStack
Returns a copy of the first contained stack in this component.If this component is empty, returns an empty stack.
- Returns:
- a copy of the first contained stack in this component
- Mappings:
Namespace Name Mixin selector named copyFirstStack
Lnet/minecraft/component/type/ContainerComponent;copyFirstStack()Lnet/minecraft/item/ItemStack;
intermediary method_58114
Lnet/minecraft/class_9288;method_58114()Lnet/minecraft/class_1799;
official a
Ldag;a()Lcxo;
-
stream
Returns a stream over copies of this component's stored item stacks.- Returns:
- a stream over copies of this component's stored item stacks
- Mappings:
Namespace Name Mixin selector named stream
Lnet/minecraft/component/type/ContainerComponent;stream()Ljava/util/stream/Stream;
intermediary method_57489
Lnet/minecraft/class_9288;method_57489()Ljava/util/stream/Stream;
official b
Ldag;b()Ljava/util/stream/Stream;
-
streamNonEmpty
Returns a stream over copies of this component's non-empty item stacks.- Returns:
- a stream over copies of this component's non-empty item stacks
- Mappings:
Namespace Name Mixin selector named streamNonEmpty
Lnet/minecraft/component/type/ContainerComponent;streamNonEmpty()Ljava/util/stream/Stream;
intermediary method_59712
Lnet/minecraft/class_9288;method_59712()Ljava/util/stream/Stream;
official c
Ldag;c()Ljava/util/stream/Stream;
-
iterateNonEmpty
Returns an iterable over this component's non-empty item stacks.The stacks should not be modified to keep this component immutable. Use
iterateNonEmptyCopy()
or the stream methods for getting freely modifiable copies of the stacks.- Returns:
- an iterable over this component's non-empty item stacks
- Mappings:
Namespace Name Mixin selector named iterateNonEmpty
Lnet/minecraft/component/type/ContainerComponent;iterateNonEmpty()Ljava/lang/Iterable;
intermediary method_59714
Lnet/minecraft/class_9288;method_59714()Ljava/lang/Iterable;
official d
Ldag;d()Ljava/lang/Iterable;
-
iterateNonEmptyCopy
Returns an iterable over copies of this component's non-empty item stacks.- Returns:
- an iterable over copies of this component's non-empty item stacks
- Mappings:
Namespace Name Mixin selector named iterateNonEmptyCopy
Lnet/minecraft/component/type/ContainerComponent;iterateNonEmptyCopy()Ljava/lang/Iterable;
intermediary method_59715
Lnet/minecraft/class_9288;method_59715()Ljava/lang/Iterable;
official e
Ldag;e()Ljava/lang/Iterable;
-
equals
-
hashCode
public int hashCode()
-