Record Class Variant

java.lang.Object
java.lang.Record
net.minecraft.client.renderer.block.model.Variant
All Implemented Interfaces:
BlockModelPart.Unbaked, ResolvableModel

public record Variant(ResourceLocation modelLocation, Variant.SimpleModelState modelState) extends Record implements BlockModelPart.Unbaked
  • Field Details

    • modelLocation

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

      private final Variant.SimpleModelState modelState
      The field for the modelState record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<Variant> MAP_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<Variant> CODEC
  • Constructor Details

    • Variant

      public Variant(ResourceLocation p_404842_)
    • Variant

      public Variant(ResourceLocation modelLocation, Variant.SimpleModelState modelState)
      Creates an instance of a Variant record class.
      Parameters:
      modelLocation - the value for the modelLocation record component
      modelState - the value for the modelState record component
  • Method Details

    • withXRot

      public Variant withXRot(Quadrant p_404895_)
    • withYRot

      public Variant withYRot(Quadrant p_404966_)
    • withUvLock

      public Variant withUvLock(boolean p_405100_)
    • withModel

      public Variant withModel(ResourceLocation p_405850_)
    • withState

      public Variant withState(Variant.SimpleModelState p_404847_)
    • with

      public Variant with(VariantMutator p_405775_)
    • bake

      public BlockModelPart bake(ModelBaker p_410762_)
      Specified by:
      bake in interface BlockModelPart.Unbaked
    • resolveDependencies

      public void resolveDependencies(ResolvableModel.Resolver p_410425_)
      Specified by:
      resolveDependencies in interface ResolvableModel
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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
    • modelState

      public Variant.SimpleModelState modelState()
      Returns the value of the modelState record component.
      Returns:
      the value of the modelState record component