java.lang.Object
io.github.thecsdev.betterstats.api.client.gui.util.StatsTabUtils

public final class StatsTabUtils extends Object
Some utility methods for initializing and handling StatsTab GUIs.
  • Field Details

    • GAP

      public static final int GAP
      The default horizontal and vertical margin BetterStats applies to various GUI elements on the BetterStatsScreen.
      See Also:
    • FILTER_ID_SHOWEMPTY

      public static final net.minecraft.util.Identifier FILTER_ID_SHOWEMPTY
      The Identifier of the "show empty stats" filter.

      Filter type: Boolean

      See Also:
    • FILTER_ID_GROUP

      public static final net.minecraft.util.Identifier FILTER_ID_GROUP
      The Identifier of the "group by" filter.

      Filter type: Enum<FilterGroupBy>

      See Also:
    • FILTER_ID_SORT_CUSTOMS

      public static final net.minecraft.util.Identifier FILTER_ID_SORT_CUSTOMS
      The Identifier of the "sort by" filter for SUGeneralStat statistics.

      Filter type: Enum<FilterSortCustomsBy>

      See Also:
    • FILTER_ID_SORT_ITEMS

      public static final net.minecraft.util.Identifier FILTER_ID_SORT_ITEMS
      The Identifier of the "sort by" filter for SUItemStat statistics.

      Filter type: Enum<FilterSortItemsBy>

      See Also:
    • FILTER_ID_SORT_MOBS

      public static final net.minecraft.util.Identifier FILTER_ID_SORT_MOBS
      The Identifier of the "sort by" filter for SUMobStat statistics.

      Filter type: Enum<FilterSortMobsBy>

      See Also:
  • Method Details

    • initDefaultFilters

      public static void initDefaultFilters(StatsTab.FiltersInitContext initContext)
      Initializes the GUI for the most basic filters such as the SelectStatsTabWidget and the search bar.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
    • initShowEmptyStatsFilter

      public static void initShowEmptyStatsFilter(StatsTab.FiltersInitContext initContext)
      Initializes the GUI TCheckboxWidget for the "show empty stats" filter.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
    • initGroupByFilter

      public static void initGroupByFilter(StatsTab.FiltersInitContext initContext)
      Initializes the GUI TSelectEnumWidget for the "group by" filter.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
    • initSortCustomsByFilter

      public static void initSortCustomsByFilter(StatsTab.FiltersInitContext initContext)
      Initializes the GUI TSelectEnumWidget for the "sort by" filter for SUGeneralStats.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
    • initSortItemsByFilter

      public static void initSortItemsByFilter(StatsTab.FiltersInitContext initContext)
      Initializes the GUI TSelectEnumWidget for the "sort by" filter for SUItemStats.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
    • initSortMobsByFilter

      public static void initSortMobsByFilter(StatsTab.FiltersInitContext initContext)
      Initializes the GUI TSelectEnumWidget for the "sort by" filter for SUMobStats.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
    • initEnumFilter

      public static <E extends Enum<E>> void initEnumFilter(StatsTab.FiltersInitContext initContext, @Nullable @Nullable io.github.thecsdev.tcdcommons.api.client.gui.util.UITexture icon, net.minecraft.util.Identifier filterId, E defaultValue) throws NullPointerException
      Initializes the GUI for an Enum-based filter.
      Type Parameters:
      E - The Enum type.
      Parameters:
      initContext - The StatsTab.FiltersInitContext.
      icon - An optional icon that will be shown beside the TSelectEnumWidget.
      filterId - The filter's unique Identifier used for getting and setting the filter's value.
      defaultValue - If the filter value is undefined, this will be used as the default one. Must not be null.
      Throws:
      NullPointerException - If an argument is null, except for the UITexture.
    • initGroupLabel

      public static io.github.thecsdev.tcdcommons.api.client.gui.other.TLabelElement initGroupLabel(io.github.thecsdev.tcdcommons.api.client.gui.panel.TPanelElement panel, net.minecraft.text.Text text)
      Initializes a TLabelElement that represents a group of elements that come after it. For example, this is used to to display the "group labels" for mob and item stats.
      Parameters:
      panel - The target TPanelElement.
      text - The TLabelElement's Text.