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 ResourceLocation
The field for themodelLocation
record component.private final Transformation
The field for therotation
record component.private final boolean
The field for theuvLock
record component.private final int
The field for theweight
record component. -
Constructor Summary
ConstructorsConstructorDescriptionVariant
(ResourceLocation modelLocation, Transformation rotation, boolean uvLock, int weight) Creates an instance of aVariant
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of themodelLocation
record component.rotation()
Returns the value of therotation
record component.final String
toString()
Returns a string representation of this record class.boolean
uvLock()
Returns the value of theuvLock
record component.int
weight()
Returns the value of theweight
record component.
-
Field Details
-
modelLocation
The field for themodelLocation
record component. -
rotation
The field for therotation
record component. -
uvLock
private final boolean uvLockThe field for theuvLock
record component. -
weight
private final int weightThe field for theweight
record component.
-
-
Constructor Details
-
Variant
Creates an instance of aVariant
record class.- Parameters:
modelLocation
- the value for themodelLocation
record componentrotation
- the value for therotation
record componentuvLock
- the value for theuvLock
record componentweight
- the value for theweight
record component
-
-
Method Details
-
getRotation
- Specified by:
getRotation
in interfaceModelState
-
isUvLocked
public boolean isUvLocked()- Specified by:
isUvLocked
in 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 themodelLocation
record component.- Returns:
- the value of the
modelLocation
record component
-
rotation
Returns the value of therotation
record component.- Returns:
- the value of the
rotation
record component
-
uvLock
public boolean uvLock()Returns the value of theuvLock
record component.- Returns:
- the value of the
uvLock
record component
-
weight
public int weight()Returns the value of theweight
record component.- Returns:
- the value of the
weight
record component
-