Record Class ArmorMatReference

java.lang.Object
java.lang.Record
com.stereowalker.unionlib.world.item.equipment.ArmorMatReference

public record ArmorMatReference(net.minecraft.resources.ResourceLocation id, int durability, Map<ArmorMatReference.ArmorSegment,Integer> defense, int enchantmentValue, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> equipSound, float toughness, float knockbackResistance, net.minecraft.tags.TagKey<net.minecraft.world.item.Item> repairIngredient) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ArmorMatReference(net.minecraft.resources.ResourceLocation id, int durability, Map<ArmorMatReference.ArmorSegment,Integer> defense, int enchantmentValue, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> equipSound, float toughness, float knockbackResistance, net.minecraft.tags.TagKey<net.minecraft.world.item.Item> repairIngredient)
    Creates an instance of a ArmorMatReference record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the defense record component.
    int
    Returns the value of the durability record component.
    int
    Returns the value of the enchantmentValue record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>
    Returns the value of the equipSound record component.
    net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial>
     
    final int
    Returns a hash code value for this object.
    net.minecraft.resources.ResourceLocation
    id()
    Returns the value of the id record component.
    float
    Returns the value of the knockbackResistance record component.
    static void
    regsiterVanilla(ArmorMatReference ref, Supplier<net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial>> mat)
     
    net.minecraft.tags.TagKey<net.minecraft.world.item.Item>
    Returns the value of the repairIngredient record component.
    final String
    Returns a string representation of this record class.
    float
    Returns the value of the toughness record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ArmorMatReference

      public ArmorMatReference(net.minecraft.resources.ResourceLocation id, int durability, Map<ArmorMatReference.ArmorSegment,Integer> defense, int enchantmentValue, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> equipSound, float toughness, float knockbackResistance, net.minecraft.tags.TagKey<net.minecraft.world.item.Item> repairIngredient)
      Creates an instance of a ArmorMatReference record class.
      Parameters:
      id - the value for the id record component
      durability - the value for the durability record component
      defense - the value for the defense record component
      enchantmentValue - the value for the enchantmentValue record component
      equipSound - the value for the equipSound record component
      toughness - the value for the toughness record component
      knockbackResistance - the value for the knockbackResistance record component
      repairIngredient - the value for the repairIngredient record component
  • Method Details

    • regsiterVanilla

      public static void regsiterVanilla(ArmorMatReference ref, Supplier<net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial>> mat)
    • getVanilla

      public net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> getVanilla()
    • 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.
    • id

      public net.minecraft.resources.ResourceLocation id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • durability

      public int durability()
      Returns the value of the durability record component.
      Returns:
      the value of the durability record component
    • defense

      Returns the value of the defense record component.
      Returns:
      the value of the defense record component
    • enchantmentValue

      public int enchantmentValue()
      Returns the value of the enchantmentValue record component.
      Returns:
      the value of the enchantmentValue record component
    • equipSound

      public net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> equipSound()
      Returns the value of the equipSound record component.
      Returns:
      the value of the equipSound record component
    • toughness

      public float toughness()
      Returns the value of the toughness record component.
      Returns:
      the value of the toughness record component
    • knockbackResistance

      public float knockbackResistance()
      Returns the value of the knockbackResistance record component.
      Returns:
      the value of the knockbackResistance record component
    • repairIngredient

      public net.minecraft.tags.TagKey<net.minecraft.world.item.Item> repairIngredient()
      Returns the value of the repairIngredient record component.
      Returns:
      the value of the repairIngredient record component