Class StatsViewGeneral
java.lang.Object
com.thecsdev.betterstats.api.mcbs.view.statsview.StatsView
com.thecsdev.betterstats.mcbs.view.statsview.SubjectStatsView<com.thecsdev.commonmc.api.stats.util.CustomStat>
com.thecsdev.betterstats.mcbs.view.statsview.StatsViewGeneral
- All Implemented Interfaces:
com.thecsdev.commonmc.api.client.gui.widget.TDropdownWidget.Entry
@Environment(CLIENT)
@Internal
public final class StatsViewGeneral
extends SubjectStatsView<com.thecsdev.commonmc.api.stats.util.CustomStat>
StatsView that displays "General" statistics.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTDropdownWidget.Entrys for overriding distance stat formatters.static enumTDropdownWidget.Entrys for groupingCustomStat.static enumTDropdownWidget.Entrys for sortingCustomStat.static enumTDropdownWidget.Entrys for overriding time stat formatters.Nested classes/interfaces inherited from class StatsView
StatsView.Filters, StatsView.FiltersInitContext, StatsView.StatsInitContext -
Field Summary
FieldsFields inherited from class SubjectStatsView
OC_DONE, OC_INPROGRESS -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull net.minecraft.network.chat.ComponentReturns the display name of thisStatsView.
ThisComponentwill be shown on the GUI to indicate the view's name.protected final @NotNull Function<Iterable<com.thecsdev.commonmc.api.stats.util.CustomStat>, LinkedHashMap<net.minecraft.network.chat.Component, Iterable<com.thecsdev.commonmc.api.stats.util.CustomStat>>> getStatsGrouper(@NotNull StatsView.Filters filters) TheFunctionthat takes a collection ofSubjectStatsand groups them into aMapbased on theStatsView.Filters.protected final @NotNull Comparator<com.thecsdev.commonmc.api.stats.util.CustomStat> getStatsSorter(@NotNull StatsView.Filters filters) final voidinitFilters(@NotNull StatsView.FiltersInitContext context) Invoked when aStatsView's filters GUI is initializing.final voidinitStats(@NotNull StatsView.StatsInitContext context) Invoked when theStatsView's statistics GUI is initializing.final voidpostProcessWidget(StatsView.StatsInitContext context, @NotNull com.thecsdev.commonmc.api.client.gui.widget.stats.TCustomStatWidget widget) Post-processes aTCustomStatWidgetafter its creation.Methods inherited from class SubjectStatsView
getStatsPredicateMethods inherited from class StatsView
getDefault
-
Field Details
-
INSTANCE
The main instance of thisClass.
-
-
Method Details
-
getDisplayName
@NotNull public final @NotNull net.minecraft.network.chat.Component getDisplayName()Description copied from class:StatsViewReturns the display name of thisStatsView.
ThisComponentwill be shown on the GUI to indicate the view's name.- Specified by:
getDisplayNamein interfacecom.thecsdev.commonmc.api.client.gui.widget.TDropdownWidget.Entry- Specified by:
getDisplayNamein classStatsView
-
initFilters
Description copied from class:StatsViewInvoked when aStatsView's filters GUI is initializing.- Overrides:
initFiltersin classStatsView- Parameters:
context- TheStatsView.FiltersInitContext.
-
initStats
Description copied from class:StatsViewInvoked when theStatsView's statistics GUI is initializing.- Specified by:
initStatsin classStatsView- Parameters:
context- TheStatsView.StatsInitContext.
-
postProcessWidget
public final void postProcessWidget(@NotNull StatsView.StatsInitContext context, @NotNull @NotNull com.thecsdev.commonmc.api.client.gui.widget.stats.TCustomStatWidget widget) Post-processes aTCustomStatWidgetafter its creation.- Parameters:
context- TheStatsView.StatsInitContext.widget- TheTCustomStatWidgetto post-process.- Throws:
NullPointerException- If any of the arguments isnull.
-
getStatsSorter
@NotNull protected final @NotNull Comparator<com.thecsdev.commonmc.api.stats.util.CustomStat> getStatsSorter(@NotNull @NotNull StatsView.Filters filters) throws NullPointerException Description copied from class:SubjectStatsView- Overrides:
getStatsSorterin classSubjectStatsView<com.thecsdev.commonmc.api.stats.util.CustomStat>- Parameters:
filters- TheStatsView.Filters.- Throws:
NullPointerException- If the argument isnull.
-
getStatsGrouper
@NotNull protected final @NotNull Function<Iterable<com.thecsdev.commonmc.api.stats.util.CustomStat>, LinkedHashMap<net.minecraft.network.chat.Component, Iterable<com.thecsdev.commonmc.api.stats.util.CustomStat>>> getStatsGrouper(@NotNull @NotNull StatsView.Filters filters) Description copied from class:SubjectStatsViewTheFunctionthat takes a collection ofSubjectStatsand groups them into aMapbased on theStatsView.Filters.- Overrides:
getStatsGrouperin classSubjectStatsView<com.thecsdev.commonmc.api.stats.util.CustomStat>- Parameters:
filters- TheStatsView.Filters.
-