java.lang.Object
io.github.thecsdev.betterstats.api.util.stats.SUStat<T>
Direct Known Subclasses:
SUGeneralStat, SUItemStat, SUMobStat, SUPlayerBadgeStat

@Internal public abstract class SUStat<T> extends Object
A "Stat utils stat".

Represents a statistic about something, whether it be about Items, or EntityTypes, or anything else. This is a utility class for easier reading of statistics about given things.

  • Field Details

    • ID_NULL

      public static final net.minecraft.util.Identifier ID_NULL
    • statsProvider

      protected final IStatsProvider statsProvider
    • statId

      protected final net.minecraft.util.Identifier statId
    • statLabel

      protected final net.minecraft.text.Text statLabel
    • statLabelSQ

      protected final String statLabelSQ
    • statIdSQ

      protected final String statIdSQ
  • Constructor Details

  • Method Details

    • getStatLabel

      public final net.minecraft.text.Text getStatLabel()
      Returns the Textual label that represents the Stat.
    • getStatID

      public final net.minecraft.util.Identifier getStatID()
      Returns the unique Identifier associated with this SUStat.

      For SUGeneralStat, refers to Stat.getValue(),
      for SUItemStat, refers to Item's Identifier,
      for SUMobStat, refers to EntityType's Identifier.

    • getStatsProvider

      public final IStatsProvider getStatsProvider()
      Returns the IStatsProvider the Stats data was obtained from.
    • matchesSearchQuery

      public boolean matchesSearchQuery(String search)
      Checks if this SUStat's statLabel matches a given "search query".
      Parameters:
      search - The search query being performed.
      See Also:
    • isEmpty

      public abstract boolean isEmpty()
      Returns true if the sum of all the Stat values associated with this SUStat is 0.