Class TEntityStatsWidget
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.widget.TClickableWidget
com.thecsdev.commonmc.api.client.gui.widget.TButtonWidget
com.thecsdev.commonmc.api.client.gui.widget.stats.TEntityStatsWidget
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
Stats widget that shows statistics about a given
EntityType.-
Nested Class Summary
Nested classes/interfaces inherited from class TButtonWidget
TButtonWidget.Flat, TButtonWidget.Paintable, TButtonWidget.Transparent -
Field Summary
Fields inherited from class TButtonWidget
LBL_PAD_X, LBL_PAD_YFields inherited from class TClickableWidget
eClicked, ONCLICK_SOUNDFields inherited from class TElement
eInitialized -
Constructor Summary
ConstructorsConstructorDescriptionTEntityStatsWidget(@Nullable EntityStats stats) TEntityStatsWidget(@NotNull net.minecraft.world.entity.EntityType<?> subject, @NotNull IStatsProvider provider) -
Method Summary
Modifier and TypeMethodDescriptionfinal IntegerPropertyTheIntegerPropertyfor this stat widget's background color.final IntegerPropertyTheIntegerPropertyfor this stat widget's focus outline color.final BooleanPropertyReturns theBooleanPropertythat determines whether this the renderedEntity's on-screen rotation follows the cursor location.final @Nullable ThrowableReturns theThrowablethat was thrown during the last attempt to create and/or render the displayEntity, if any.protected final voidCallback method that is invoked when thisTElementis initializing.final IntegerPropertyTheIntegerPropertyfor this stat widget's outline color.voidpostRenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked after thisNodeand all of their children have been rendered.voidrenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked when thisNodeis being rendered.final ObjectProperty<EntityStats> TheObjectPropertyholding theEntityStatswhose statistics are to be shown.protected final voidCallback method that is invoked automatically every GUI tick, if and afterNode.getParent()ticks.Methods inherited from class TButtonWidget
getLabelMethods inherited from class TClickableWidget
click, clickCallback, dragEndCallback, dragStartCallback, enabledProperty, focusLostCallback, getCursor, hoverGainedCallback, inputCallback, isFocusable, pressedPropertyMethods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, findElementAt, focusableProperty, focusGainedCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getSelf, getTooltip, hoverableProperty, hoverLostCallback, invalidateTooltipCache, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tooltipProperty, toString, visiblePropertyMethods inherited from class 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
-
TEntityStatsWidget
public TEntityStatsWidget() -
TEntityStatsWidget
public TEntityStatsWidget(@NotNull @NotNull net.minecraft.world.entity.EntityType<?> subject, @NotNull @NotNull IStatsProvider provider) -
TEntityStatsWidget
-
-
Method Details
-
statsProperty
TheObjectPropertyholding theEntityStatswhose statistics are to be shown. -
followsCursorProperty
Returns theBooleanPropertythat determines whether this the renderedEntity's on-screen rotation follows the cursor location.- See Also:
-
getDisplayError
-
initCallback
protected final void initCallback()Description copied from class:TElementCallback method that is invoked when thisTElementis initializing. You may override this method to create and add childTElements.- Overrides:
initCallbackin classTButtonWidget- See Also:
-
tickCallback
protected final void tickCallback()Description copied from class:TElementCallback method that is invoked automatically every GUI tick, if and afterNode.getParent()ticks.For performance optimization reasons, this is invoked if this element is contained within its parent's
TElement.getBounds().Note that this is regardless of what
TElement.isVisible()returns. The only requirements are the element being "within parent bounds" and the parent having ticked.- Overrides:
tickCallbackin classTElement
-
backgroundColorProperty
TheIntegerPropertyfor this stat widget's background color. This color is drawn in the background of this element. -
outlineColorProperty
TheIntegerPropertyfor this stat widget's outline color. This color is drawn as the outline. -
focusOutlineColorProperty
TheIntegerPropertyfor this stat widget's focus outline color. This color is drawn as the outline when this element is focused. -
renderCallback
Description copied from interface:INodeRenderableCallback method that is invoked when thisNodeis being rendered.- Specified by:
renderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
renderCallbackin classTButtonWidget- Parameters:
pencil- The rendering context.
-
postRenderCallback
Description copied from interface:INodeRenderableCallback method that is invoked after thisNodeand all of their children have been rendered.- Specified by:
postRenderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
postRenderCallbackin classTClickableWidget- Parameters:
pencil- The rendering context.
-