Class TEntityElement
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.misc.TEntityElement
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUtility class for providingEntityinstances for rendering in GUIs. -
Field Summary
Fields inherited from class TElement
eInitialized -
Constructor Summary
ConstructorsConstructorDescriptionTEntityElement(@NotNull net.minecraft.world.entity.EntityType<?> entityType) -
Method Summary
Modifier and TypeMethodDescriptionfinal DoublePropertyReturns theDoublePropertythat determines the scale at which the renderedEntityis drawn.final NotNullProperty<net.minecraft.world.entity.EntityType<?>> final BooleanPropertyReturns theBooleanPropertythat determines whether this the renderedEntity's on-screen rotation follows the cursor location.final @Nullable net.minecraft.world.entity.Entityfinal @Nullable ThrowableReturns theThrowablethat was thrown during the last attempt to create and/or render the displayEntity, if any.voidrenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked when thisNodeis being rendered.Methods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, initCallback, inputCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, postRenderCallback, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, 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
-
TEntityElement
public TEntityElement(@NotNull @NotNull net.minecraft.world.entity.EntityType<?> entityType) -
TEntityElement
public TEntityElement()
-
-
Method Details
-
entityTypeProperty
-
followsCursorProperty
Returns theBooleanPropertythat determines whether this the renderedEntity's on-screen rotation follows the cursor location. -
entityScaleProperty
Returns theDoublePropertythat determines the scale at which the renderedEntityis drawn. -
getDisplayError
Returns theThrowablethat was thrown during the last attempt to create and/or render the displayEntity, if any.This is usually used for debugging purposes, as some modded entities do not support being rendered on-screen, and will throw when attempts are made to create and/or render them. In such cases, this method can be used to retrieve the exception that was thrown.
-
getDisplayEntity
@Nullable public final @Nullable net.minecraft.world.entity.Entity getDisplayEntity()CachedEntityinstance used by thisTEntityElementfor rendering saidEntityon the GUI screen.This value is assigned automatically. You should avoid trying to set this value, instead only read it in case you are overriding
renderCallback(TGuiGraphics).In addition, this value is
nullwhenever something goes wrong when attempting to create and/or render theEntityinstance. This is usually due toExceptions being raised during attempts to render the displayEntity.- See Also:
-
renderCallback
Description copied from interface:INodeRenderableCallback method that is invoked when thisNodeis being rendered.- Specified by:
renderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
renderCallbackin classTElement- Parameters:
pencil- The rendering context.
-