Record Class CustomModelDataProperty
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.item.properties.numeric.CustomModelDataProperty
- All Implemented Interfaces:
RangeSelectItemModelProperty
public record CustomModelDataProperty(int index)
extends Record
implements RangeSelectItemModelProperty
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theindexrecord component.static final com.mojang.serialization.MapCodec<CustomModelDataProperty> -
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.floatget(ItemStack p_386883_, ClientLevel p_387867_, ItemOwner p_434671_, int p_388040_) 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.com.mojang.serialization.MapCodec<CustomModelDataProperty> type()
-
Field Details
-
index
private final int indexThe field for theindexrecord component. -
MAP_CODEC
-
-
Constructor Details
-
CustomModelDataProperty
public CustomModelDataProperty(int index) Creates an instance of aCustomModelDataPropertyrecord class.- Parameters:
index- the value for theindexrecord component
-
-
Method Details
-
get
public float get(ItemStack p_386883_, @Nullable ClientLevel p_387867_, @Nullable ItemOwner p_434671_, int p_388040_) - Specified by:
getin interfaceRangeSelectItemModelProperty
-
type
- Specified by:
typein interfaceRangeSelectItemModelProperty
-
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
-