Class StatsSummaryPanel
java.lang.Object
com.thecsdev.common.scene.Node<com.thecsdev.commonmc.api.client.gui.TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.panel.TPanelElement
com.thecsdev.commonmc.api.client.gui.panel.TPanelElement.Paintable
com.thecsdev.betterstats.client.gui.panel.StatsSummaryPanel
- All Implemented Interfaces:
com.thecsdev.common.scene.INode<com.thecsdev.commonmc.api.client.gui.TElement>, com.thecsdev.common.scene.INodeBounded<com.thecsdev.commonmc.api.client.gui.TElement, com.thecsdev.common.math.Bounds2i>, com.thecsdev.common.scene.INodeRenderable<com.thecsdev.commonmc.api.client.gui.TElement, com.thecsdev.commonmc.api.client.gui.render.TGuiGraphics>, Iterable<com.thecsdev.commonmc.api.client.gui.TElement>, Collection<com.thecsdev.commonmc.api.client.gui.TElement>
@Internal
@Environment(CLIENT)
public final class StatsSummaryPanel
extends com.thecsdev.commonmc.api.client.gui.panel.TPanelElement.Paintable
TPanelElement that displays TTextualStatWidget elements
that aim to summarize the statistics on a given StatsView.-
Nested Class Summary
Nested classes/interfaces inherited from class com.thecsdev.commonmc.api.client.gui.panel.TPanelElement
com.thecsdev.commonmc.api.client.gui.panel.TPanelElement.Paintable, com.thecsdev.commonmc.api.client.gui.panel.TPanelElement.Transparent -
Field Summary
Fields inherited from class com.thecsdev.commonmc.api.client.gui.panel.TPanelElement
COLOR_BACKGROUND, COLOR_OUTLINE, COLOR_OUTLINE_FOCUSEDFields inherited from class com.thecsdev.commonmc.api.client.gui.TElement
eInitialized -
Constructor Summary
ConstructorsConstructorDescriptionStatsSummaryPanel(@NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats) -
Method Summary
Modifier and TypeMethodDescriptionfinal Collection<com.thecsdev.commonmc.api.client.gui.widget.stats.TTextualStatWidget> Returns the entries that are to be included by thisStatsSummaryPanel.protected final voidstatic final voidinitPanel(@NotNull com.thecsdev.commonmc.api.client.gui.panel.TPanelElement target, @NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats) Initializes aStatsSummaryPanelon the given targetTPanelElement, using the providedSubjectStatscollection as the source of data to summarize.static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<net.minecraft.world.entity.EntityType<?>>, Integer> summarizeEntityStats(@NotNull Collection<com.thecsdev.commonmc.api.stats.util.EntityStats> stats) Summarizes aCollectionofEntityStatsinto aLinkedHashMapthat maps eachStatTypeto the total integer value of that statistic across all providedEntityStats.static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<net.minecraft.world.item.Item>, Integer> summarizeItemStats(@NotNull Collection<com.thecsdev.commonmc.api.stats.util.ItemStats> stats) Summarizes aCollectionofItemStatsinto aLinkedHashMapthat maps eachnet.minecraft.stats.StatType<net.minecraft.world.item.Item>to the total integer value of that statistic across all providedItemStats.static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<?>, Integer> summarizeStats(@NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats) Summarizes aCollectionofSubjectStatsinto aLinkedHashMapthat maps eachStatTypeto the total integer value of that statistic across all providedSubjectStats.Methods inherited from class com.thecsdev.commonmc.api.client.gui.panel.TPanelElement.Paintable
backgroundColorProperty, focusedOutlineColorProperty, outlineColorProperty, postRenderCallback, renderCallbackMethods inherited from class com.thecsdev.commonmc.api.client.gui.panel.TPanelElement
addAllVertically, computeNextXBounds, computeNextYBounds, inputCallback, scroll, scrollAmountProperty, scrollPaddingProperty, scrollSensitivityPropertyMethods inherited from class com.thecsdev.commonmc.api.client.gui.TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, tooltipProperty, toString, visiblePropertyMethods inherited from class com.thecsdev.common.scene.Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Constructor Details
-
StatsSummaryPanel
public StatsSummaryPanel() -
StatsSummaryPanel
public StatsSummaryPanel(@NotNull @NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats)
-
-
Method Details
-
getEntries
public final Collection<com.thecsdev.commonmc.api.client.gui.widget.stats.TTextualStatWidget> getEntries()Returns the entries that are to be included by thisStatsSummaryPanel. The entries areTTextualStatWidgetelements that have custom name and value labels, that are then automatically placed into thisStatsSummaryPanelduringinitCallback().- See Also:
-
initCallback
protected final void initCallback()- Overrides:
initCallbackin classcom.thecsdev.commonmc.api.client.gui.TElement
-
summarizeItemStats
@NotNull public static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<net.minecraft.world.item.Item>, Integer> summarizeItemStats(@NotNull @NotNull Collection<com.thecsdev.commonmc.api.stats.util.ItemStats> stats) throws NullPointerException Summarizes aCollectionofItemStatsinto aLinkedHashMapthat maps eachnet.minecraft.stats.StatType<net.minecraft.world.item.Item>to the total integer value of that statistic across all providedItemStats.- Parameters:
stats- The collection ofItemStatsto summarize.- Throws:
NullPointerException- If the argument isnull.
-
summarizeEntityStats
@NotNull public static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<net.minecraft.world.entity.EntityType<?>>, Integer> summarizeEntityStats(@NotNull @NotNull Collection<com.thecsdev.commonmc.api.stats.util.EntityStats> stats) throws NullPointerException Summarizes aCollectionofEntityStatsinto aLinkedHashMapthat maps eachStatTypeto the total integer value of that statistic across all providedEntityStats.- Parameters:
stats- The collection ofEntityStatsto summarize.- Throws:
NullPointerException- If the argument isnull.
-
summarizeStats
@NotNull public static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<?>, Integer> summarizeStats(@NotNull @NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats) throws NullPointerException Summarizes aCollectionofSubjectStatsinto aLinkedHashMapthat maps eachStatTypeto the total integer value of that statistic across all providedSubjectStats.- Parameters:
stats- The collection ofSubjectStatsto summarize.- Throws:
NullPointerException- If the argument isnull.
-
initPanel
public static final void initPanel(@NotNull @NotNull com.thecsdev.commonmc.api.client.gui.panel.TPanelElement target, @NotNull @NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats) Initializes aStatsSummaryPanelon the given targetTPanelElement, using the providedSubjectStatscollection as the source of data to summarize.- Parameters:
target- The targetTPanelElementto initialize theStatsSummaryPanelon.stats- The collection ofSubjectStatsto summarize.- Throws:
NullPointerException- If an argument isnull.
-