Record Class CustomModelDataProperty
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.properties.select.CustomModelDataProperty
- All Implemented Interfaces:
SelectItemModelProperty<String>
public record CustomModelDataProperty(int index)
extends Record
implements SelectItemModelProperty<String>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.renderer.item.properties.select.SelectItemModelProperty
SelectItemModelProperty.Type<P extends SelectItemModelProperty<T>,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theindexrecord component.static final SelectItemModelProperty.Type<CustomModelDataProperty, String> static final com.mojang.serialization.codecs.PrimitiveCodec<String> -
Constructor Summary
ConstructorsConstructorDescriptionCustomModelDataProperty(int index) Creates an instance of aCustomModelDataPropertyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.get(ItemStack p_388036_, ClientLevel p_387600_, LivingEntity p_388624_, int p_388055_, ItemDisplayContext p_387132_) final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.final StringtoString()Returns a string representation of this record class.type()com.mojang.serialization.Codec<String>
-
Field Details
-
index
private final int indexThe field for theindexrecord component. -
VALUE_CODEC
-
TYPE
-
-
Constructor Details
-
CustomModelDataProperty
public CustomModelDataProperty(int index) Creates an instance of aCustomModelDataPropertyrecord class.- Parameters:
index- the value for theindexrecord component
-
-
Method Details
-
get
@Nullable public String get(ItemStack p_388036_, @Nullable ClientLevel p_387600_, @Nullable LivingEntity p_388624_, int p_388055_, ItemDisplayContext p_387132_) - Specified by:
getin interfaceSelectItemModelProperty<String>
-
type
- Specified by:
typein interfaceSelectItemModelProperty<String>
-
valueCodec
- Specified by:
valueCodecin interfaceSelectItemModelProperty<String>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-