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_FOCUSED

    Fields inherited from class com.thecsdev.commonmc.api.client.gui.TElement

    eInitialized
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    StatsSummaryPanel(@NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Collection<com.thecsdev.commonmc.api.client.gui.widget.stats.TTextualStatWidget>
    Returns the entries that are to be included by this StatsSummaryPanel.
    protected final void
     
    static final void
    initPanel(@NotNull com.thecsdev.commonmc.api.client.gui.panel.TPanelElement target, @NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats)
    Initializes a StatsSummaryPanel on the given target TPanelElement, using the provided SubjectStats collection 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 a Collection of EntityStats into a LinkedHashMap that maps each StatType to the total integer value of that statistic across all provided EntityStats.
    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 a Collection of ItemStats into a LinkedHashMap that maps each net.minecraft.stats.StatType<net.minecraft.world.item.Item> to the total integer value of that statistic across all provided ItemStats.
    static final @NotNull LinkedHashMap<net.minecraft.stats.StatType<?>, Integer>
    summarizeStats(@NotNull Collection<? extends com.thecsdev.commonmc.api.stats.util.SubjectStats<?>> stats)
    Summarizes a Collection of SubjectStats into a LinkedHashMap that maps each StatType to the total integer value of that statistic across all provided SubjectStats.

    Methods inherited from class com.thecsdev.commonmc.api.client.gui.panel.TPanelElement.Paintable

    backgroundColorProperty, focusedOutlineColorProperty, outlineColorProperty, postRenderCallback, renderCallback

    Methods inherited from class com.thecsdev.commonmc.api.client.gui.panel.TPanelElement

    addAllVertically, computeNextXBounds, computeNextYBounds, inputCallback, scroll, scrollAmountProperty, scrollPaddingProperty, scrollSensitivityProperty

    Methods 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, visibleProperty

    Methods 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

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Iterable

    forEach
  • 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 this StatsSummaryPanel. The entries are TTextualStatWidget elements that have custom name and value labels, that are then automatically placed into this StatsSummaryPanel during initCallback().
      See Also:
      • TTextualStatWidget.getKeyLabel()
      • TTextualStatWidget.getValueLabel()
    • initCallback

      protected final void initCallback()
      Overrides:
      initCallback in class com.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 a Collection of ItemStats into a LinkedHashMap that maps each net.minecraft.stats.StatType<net.minecraft.world.item.Item> to the total integer value of that statistic across all provided ItemStats.
      Parameters:
      stats - The collection of ItemStats to summarize.
      Throws:
      NullPointerException - If the argument is null.
    • 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 a Collection of EntityStats into a LinkedHashMap that maps each StatType to the total integer value of that statistic across all provided EntityStats.
      Parameters:
      stats - The collection of EntityStats to summarize.
      Throws:
      NullPointerException - If the argument is null.
    • 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 a Collection of SubjectStats into a LinkedHashMap that maps each StatType to the total integer value of that statistic across all provided SubjectStats.
      Parameters:
      stats - The collection of SubjectStats to summarize.
      Throws:
      NullPointerException - If the argument is null.
    • 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 a StatsSummaryPanel on the given target TPanelElement, using the provided SubjectStats collection as the source of data to summarize.
      Parameters:
      target - The target TPanelElement to initialize the StatsSummaryPanel on.
      stats - The collection of SubjectStats to summarize.
      Throws:
      NullPointerException - If an argument is null.