Record Class ModelAndTexture<T>

java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.ModelAndTexture<T>

public record ModelAndTexture<T>(T model, ClientAsset asset) extends Record
  • Field Details

    • model

      private final T model
      The field for the model record component.
    • asset

      private final ClientAsset asset
      The field for the asset record component.
  • Constructor Details

    • ModelAndTexture

      public ModelAndTexture(T p_400126_, ResourceLocation p_400299_)
    • ModelAndTexture

      public ModelAndTexture(T model, ClientAsset asset)
      Creates an instance of a ModelAndTexture record class.
      Parameters:
      model - the value for the model record component
      asset - the value for the asset record component
  • Method Details

    • codec

      public static <T> com.mojang.serialization.MapCodec<ModelAndTexture<T>> codec(com.mojang.serialization.Codec<T> p_399564_, T p_400177_)
    • streamCodec

      public static <T> StreamCodec<RegistryFriendlyByteBuf,ModelAndTexture<T>> streamCodec(StreamCodec<? super RegistryFriendlyByteBuf,T> p_400232_)
    • 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.
    • model

      public T model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • asset

      public ClientAsset asset()
      Returns the value of the asset record component.
      Returns:
      the value of the asset record component