Record Class Variant
java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.Variant
- All Implemented Interfaces:
ModelState
public record Variant(ResourceLocation modelLocation, Transformation rotation, boolean uvLock, int weight)
extends Record
implements ModelState
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceLocationThe field for themodelLocationrecord component.private final TransformationThe field for therotationrecord component.private final booleanThe field for theuvLockrecord component.private final intThe field for theweightrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVariant(ResourceLocation modelLocation, Transformation rotation, boolean uvLock, int weight) Creates an instance of aVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of themodelLocationrecord component.rotation()Returns the value of therotationrecord component.final StringtoString()Returns a string representation of this record class.booleanuvLock()Returns the value of theuvLockrecord component.intweight()Returns the value of theweightrecord component.
-
Field Details
-
modelLocation
The field for themodelLocationrecord component. -
rotation
The field for therotationrecord component. -
uvLock
private final boolean uvLockThe field for theuvLockrecord component. -
weight
private final int weightThe field for theweightrecord component.
-
-
Constructor Details
-
Variant
Creates an instance of aVariantrecord class.- Parameters:
modelLocation- the value for themodelLocationrecord componentrotation- the value for therotationrecord componentuvLock- the value for theuvLockrecord componentweight- the value for theweightrecord component
-
-
Method Details
-
getRotation
- Specified by:
getRotationin interfaceModelState
-
isUvLocked
public boolean isUvLocked()- Specified by:
isUvLockedin interfaceModelState
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
modelLocation
Returns the value of themodelLocationrecord component.- Returns:
- the value of the
modelLocationrecord component
-
rotation
Returns the value of therotationrecord component.- Returns:
- the value of the
rotationrecord component
-
uvLock
public boolean uvLock()Returns the value of theuvLockrecord component.- Returns:
- the value of the
uvLockrecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-