Record Class ComponentContents<T>
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.properties.select.ComponentContents<T>
- All Implemented Interfaces:
SelectItemModelProperty<T>
public record ComponentContents<T>(DataComponentType<T> componentType)
extends Record
implements SelectItemModelProperty<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface SelectItemModelProperty
SelectItemModelProperty.Type<P,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataComponentType<T> The field for thecomponentTyperecord component.private static final SelectItemModelProperty.Type<? extends ComponentContents<?>, ?> -
Constructor Summary
ConstructorsConstructorDescriptionComponentContents(DataComponentType<T> componentType) Creates an instance of aComponentContentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> SelectItemModelProperty.Type<ComponentContents<T>, T> castType()Returns the value of thecomponentTyperecord component.private static <T> SelectItemModelProperty.Type<ComponentContents<T>, T> final booleanIndicates whether some other object is "equal to" this one.@Nullable Tget(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()com.mojang.serialization.Codec<T>
-
Field Details
-
componentType
The field for thecomponentTyperecord component. -
TYPE
-
-
Constructor Details
-
ComponentContents
Creates an instance of aComponentContentsrecord class.- Parameters:
componentType- the value for thecomponentTyperecord component
-
-
Method Details
-
createType
-
castType
-
get
public @Nullable T get(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext) - Specified by:
getin interfaceSelectItemModelProperty<T>
-
type
- Specified by:
typein interfaceSelectItemModelProperty<T>
-
valueCodec
- Specified by:
valueCodecin interfaceSelectItemModelProperty<T>
-
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). -
componentType
Returns the value of thecomponentTyperecord component.- Returns:
- the value of the
componentTyperecord component
-