Record Class CustomModelData
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.CustomModelData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CustomModelData> The field for thecolorsrecord component.static final CustomModelDataThe field for theflagsrecord component.The field for thefloatsrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, CustomModelData> The field for thestringsrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolors()Returns the value of thecolorsrecord component.final booleanIndicates whether some other object is "equal to" this one.flags()Returns the value of theflagsrecord component.floats()Returns the value of thefloatsrecord component.getBoolean(int pIndex) getColor(int pIndex) getFloat(int pIndex) private static <T> TgetString(int pIndex) final inthashCode()Returns a hash code value for this object.strings()Returns the value of thestringsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
floats
The field for thefloatsrecord component. -
flags
The field for theflagsrecord component. -
strings
The field for thestringsrecord component. -
colors
The field for thecolorsrecord component. -
EMPTY
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
CustomModelData
public CustomModelData(List<Float> floats, List<Boolean> flags, List<String> strings, List<Integer> colors) Creates an instance of aCustomModelDatarecord class.- Parameters:
floats- the value for thefloatsrecord componentflags- the value for theflagsrecord componentstrings- the value for thestringsrecord componentcolors- the value for thecolorsrecord component
-
-
Method Details
-
getSafe
-
getFloat
-
getBoolean
-
getString
-
getColor
-
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 withObjects::equals(Object,Object). -
floats
Returns the value of thefloatsrecord component.- Returns:
- the value of the
floatsrecord component
-
flags
Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-
strings
Returns the value of thestringsrecord component.- Returns:
- the value of the
stringsrecord component
-
colors
Returns the value of thecolorsrecord component.- Returns:
- the value of the
colorsrecord component
-