Record Class ContainerComponentManipulator.ComponentSlotCollection<T extends ContainerComponent<T>>
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.ContainerComponentManipulator.ComponentSlotCollection<T>
- All Implemented Interfaces:
SlotCollection
- Enclosing class:
ContainerComponentManipulator<T extends ContainerComponent<T>>
private static record ContainerComponentManipulator.ComponentSlotCollection<T extends ContainerComponent<T>>(ItemStack itemStack, ContainerComponentManipulator<T extends ContainerComponent<T>> component)
extends Record
implements SlotCollection
-
Nested Class Summary
Nested classes/interfaces inherited from interface SlotCollection
SlotCollection.Filtered, SlotCollection.FlatMapped, SlotCollection.Limited -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerComponentManipulator<T> The field for thecomponentrecord component.private final ItemStackThe field for theitemStackrecord component.Fields inherited from interface SlotCollection
EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateComponentSlotCollection(ItemStack itemStack, ContainerComponentManipulator<T> component) Creates an instance of aComponentSlotCollectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theitemStackrecord component.voidmodifySlots(Consumer<? super SlotAccess> consumer, SlotSelector slotSelector) intreplaceSlotItems(ItemProvider items, SlotSelector slotSelector) intsize()final StringtoString()Returns a string representation of this record class.Methods inherited from interface SlotCollection
filter, flatMap, limit, modifySlots, replaceSlotItems
-
Field Details
-
itemStack
The field for theitemStackrecord component. -
component
The field for thecomponentrecord component.
-
-
Constructor Details
-
ComponentSlotCollection
Creates an instance of aComponentSlotCollectionrecord class.- Parameters:
itemStack- the value for theitemStackrecord componentcomponent- the value for thecomponentrecord component
-
-
Method Details
-
itemCopies
- Specified by:
itemCopiesin interfaceSlotCollection
-
size
public int size()- Specified by:
sizein interfaceSlotCollection
-
replaceSlotItems
- Specified by:
replaceSlotItemsin interfaceSlotCollection
-
modifySlots
- Specified by:
modifySlotsin interfaceSlotCollection
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
itemStack
Returns the value of theitemStackrecord component.- Returns:
- the value of the
itemStackrecord component
-
component
Returns the value of thecomponentrecord component.- Returns:
- the value of the
componentrecord component
-