Record Class BlacksmithTrade

java.lang.Object
java.lang.Record
com.wdiscute.echoes.upgrades.BlacksmithTrade

public record BlacksmithTrade(List<BlacksmithTrade.Entry> entries, int weight, boolean hasUpgrades) extends Record
  • Field Details

  • Constructor Details

    • BlacksmithTrade

      public BlacksmithTrade(List<BlacksmithTrade.Entry> entries, int weight, boolean hasUpgrades)
      Creates an instance of a BlacksmithTrade record class.
      Parameters:
      entries - the value for the entries record component
      weight - the value for the weight record component
      hasUpgrades - the value for the hasUpgrades record component
  • Method Details

    • getBase

      public BlacksmithTrade.Entry getBase()
    • getDisplayCost

      public List<com.wdiscute.utils.MaybeStack> getDisplayCost()
    • getRandomTradeForDisplay

      public static com.wdiscute.utils.Utils.Duo<BlacksmithTrade.Entry,net.minecraft.resources.ResourceLocation> getRandomTradeForDisplay(net.minecraft.server.level.ServerLevel sl)
    • getRandomTrade

      public static com.wdiscute.utils.Utils.Duo<BlacksmithTrade,net.minecraft.resources.ResourceLocation> getRandomTrade(net.minecraft.server.level.ServerLevel sl)
    • getNext

      public BlacksmithTrade.Entry getNext(Rarity rarity)
    • 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.
    • entries

      public List<BlacksmithTrade.Entry> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component
    • weight

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

      public boolean hasUpgrades()
      Returns the value of the hasUpgrades record component.
      Returns:
      the value of the hasUpgrades record component