Class Stats

java.lang.Object
mindustry.world.meta.Stats

public class Stats extends Object
Hold and organizes a list of block stats.
  • Field Details

    • useCategories

      public boolean useCategories
      Whether to display stats with categories. If false, categories are completely ignored during display.
    • intialized

      public boolean intialized
      Whether these stats are initialized yet.
    • timePeriod

      public float timePeriod
      Production time period in ticks. Used for crafters.
  • Constructor Details

    • Stats

      public Stats()
  • Method Details

    • add

      public void add(Stat stat, float value, StatUnit unit)
      Adds a single float value with this stat, formatted to 2 decimal places.
    • add

      public void add(Stat stat, float value)
      Adds a single float value with this stat and no unit.
    • addPercent

      public void addPercent(Stat stat, float value)
      Adds an integer percent stat value. Value is assumed to be in the 0-1 range.
    • add

      public void add(Stat stat, boolean value)
      Adds a single y/n boolean value.
    • add

      public void add(Stat stat, Item item)
      Adds an item value.
    • add

      public void add(Stat stat, ItemStack item)
      Adds an item value.
    • add

      public void add(Stat stat, Liquid liquid, float amount, boolean perSecond)
      Adds an item value.
    • add

      public void add(Stat stat, Attribute attr)
    • add

      public void add(Stat stat, Attribute attr, float scale)
    • add

      public void add(Stat stat, Attribute attr, boolean floating)
    • add

      public void add(Stat stat, Attribute attr, boolean floating, float scale, boolean startZero)
    • add

      public void add(Stat stat, String format, Object... args)
      Adds a single string value with this stat.
    • add

      public void add(Stat stat, StatValue value)
      Adds a stat value.
    • remove

      public void remove(Stat stat)
      Removes a stat, if it exists.
    • toMap