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
  • Field Details

    • modelLocation

      private final ResourceLocation modelLocation
      The field for the modelLocation record component.
    • rotation

      private final Transformation rotation
      The field for the rotation record component.
    • uvLock

      private final boolean uvLock
      The field for the uvLock record component.
    • weight

      private final int weight
      The field for the weight record component.
  • Constructor Details

    • Variant

      public Variant(ResourceLocation modelLocation, Transformation rotation, boolean uvLock, int weight)
      Creates an instance of a Variant record class.
      Parameters:
      modelLocation - the value for the modelLocation record component
      rotation - the value for the rotation record component
      uvLock - the value for the uvLock record component
      weight - the value for the weight record component
  • Method Details

    • getRotation

      public Transformation getRotation()
      Specified by:
      getRotation in interface ModelState
    • isUvLocked

      public boolean isUvLocked()
      Specified by:
      isUvLocked in interface ModelState
    • toString

      public final 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • modelLocation

      public ResourceLocation modelLocation()
      Returns the value of the modelLocation record component.
      Returns:
      the value of the modelLocation record component
    • rotation

      public Transformation rotation()
      Returns the value of the rotation record component.
      Returns:
      the value of the rotation record component
    • uvLock

      public boolean uvLock()
      Returns the value of the uvLock record component.
      Returns:
      the value of the uvLock record component
    • weight

      public int weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component