Class SUGeneralStat

java.lang.Object
io.github.thecsdev.betterstats.api.util.stats.SUStat<net.minecraft.util.Identifier>
io.github.thecsdev.betterstats.api.util.stats.SUGeneralStat

public final class SUGeneralStat extends SUStat<net.minecraft.util.Identifier>
  • Field Details

    • TEXT_VALUE

      public static final net.minecraft.text.Text TEXT_VALUE
    • value

      public final int value
      The raw Integer value of this Stat.
    • valueText

      public final net.minecraft.text.Text valueText
      The formatted Textual user-friendly version of this Stat's value.
      See Also:
      • Stat.format(int)
  • Constructor Details

    • SUGeneralStat

      public SUGeneralStat(IStatsProvider statsProvider, net.minecraft.stat.Stat<net.minecraft.util.Identifier> stat)
  • Method Details

    • getGeneralStat

      public final net.minecraft.stat.Stat<net.minecraft.util.Identifier> getGeneralStat()
      Returns the "general" Stat that corresponds with this SUGeneralStat.
    • isEmpty

      public final boolean isEmpty()
      Description copied from class: SUStat
      Returns true if the sum of all the Stat values associated with this SUStat is 0.
      Specified by:
      isEmpty in class SUStat<net.minecraft.util.Identifier>
    • getGeneralStatTranslationKey

      public static String getGeneralStatTranslationKey(net.minecraft.stat.Stat<net.minecraft.util.Identifier> stat)
      Returns the translation key for a given Stat.
      Parameters:
      stat - The statistic in question.
    • getGeneralStatText

      public static net.minecraft.text.Text getGeneralStatText(net.minecraft.stat.Stat<net.minecraft.util.Identifier> stat)
      Returns the Text that should correspond to a given general SUGeneralStat, using getGeneralStatTranslationKey(Stat).
    • getGeneralStats

      public static List<SUGeneralStat> getGeneralStats(IStatsProvider statsProvider, @Nullable @Nullable Predicate<SUGeneralStat> filter)
      Obtains a list of all "general" Stats in form of SUGeneralStat.
      Parameters:
      statsProvider - The IStatsProvider.
      filter - Optional. A Predicate used to filter out any unwanted SUGeneralStats.