Record Class TrimMaterial

java.lang.Object
java.lang.Record
net.minecraft.world.item.armortrim.TrimMaterial

public record TrimMaterial(String assetName, Holder<Item> ingredient, float itemModelIndex, Map<Holder<ArmorMaterial>,String> overrideArmorMaterials, Component description) extends Record
  • Field Details

    • assetName

      private final String assetName
      The field for the assetName record component.
    • ingredient

      private final Holder<Item> ingredient
      The field for the ingredient record component.
    • itemModelIndex

      private final float itemModelIndex
      The field for the itemModelIndex record component.
    • overrideArmorMaterials

      private final Map<Holder<ArmorMaterial>,String> overrideArmorMaterials
      The field for the overrideArmorMaterials record component.
    • description

      private final Component description
      The field for the description record component.
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<TrimMaterial> DIRECT_CODEC
    • DIRECT_STREAM_CODEC

      public static final StreamCodec<RegistryFriendlyByteBuf,TrimMaterial> DIRECT_STREAM_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<Holder<TrimMaterial>> CODEC
    • STREAM_CODEC

      public static final StreamCodec<RegistryFriendlyByteBuf,Holder<TrimMaterial>> STREAM_CODEC
  • Constructor Details

    • TrimMaterial

      public TrimMaterial(String assetName, Holder<Item> ingredient, float itemModelIndex, Map<Holder<ArmorMaterial>,String> overrideArmorMaterials, Component description)
      Creates an instance of a TrimMaterial record class.
      Parameters:
      assetName - the value for the assetName record component
      ingredient - the value for the ingredient record component
      itemModelIndex - the value for the itemModelIndex record component
      overrideArmorMaterials - the value for the overrideArmorMaterials record component
      description - the value for the description record component
  • Method Details

    • create

      public static TrimMaterial create(String p_268108_, Item p_268361_, float p_268202_, Component p_268273_, Map<Holder<ArmorMaterial>,String> p_267977_)
    • 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.
    • assetName

      public String assetName()
      Returns the value of the assetName record component.
      Returns:
      the value of the assetName record component
    • ingredient

      public Holder<Item> ingredient()
      Returns the value of the ingredient record component.
      Returns:
      the value of the ingredient record component
    • itemModelIndex

      public float itemModelIndex()
      Returns the value of the itemModelIndex record component.
      Returns:
      the value of the itemModelIndex record component
    • overrideArmorMaterials

      public Map<Holder<ArmorMaterial>,String> overrideArmorMaterials()
      Returns the value of the overrideArmorMaterials record component.
      Returns:
      the value of the overrideArmorMaterials record component
    • description

      public Component description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component