Record Class ContainerComponentManipulator<T extends ContainerComponent<T>>
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.ContainerComponentManipulator<T>
public record ContainerComponentManipulator<T extends ContainerComponent<T>>(DataComponentType<T extends ContainerComponent<T>> type, T extends ContainerComponent<T> empty)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TThe field for theemptyrecord component.private final DataComponentType<T> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContainerComponentManipulator(DataComponentType<T> type, T empty) Creates an instance of aContainerComponentManipulatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionempty()Returns the value of theemptyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidmodifyItems(ItemStack itemStack, UnaryOperator<ItemStack> modifier) voidsetContents(ItemStack itemStack, Stream<ItemStack> newContents) voidsetContents(ItemStack itemStack, T defaultValue, Stream<ItemStack> newContents) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
type
The field for thetyperecord component. -
empty
The field for theemptyrecord component.
-
-
Constructor Details
-
ContainerComponentManipulator
Creates an instance of aContainerComponentManipulatorrecord class.- Parameters:
type- the value for thetyperecord componentempty- the value for theemptyrecord component
-
-
Method Details
-
setContents
-
setContents
-
modifyItems
-
getSlots
-
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
empty
Returns the value of theemptyrecord component.- Returns:
- the value of the
emptyrecord component
-