Class TEntityRendererElement

All Implemented Interfaces:
TParentElement, ITooltipProvider, IEnableStateProvider

public class TEntityRendererElement extends TBlankElement
  • Field Details

    • entity

      @Nullable protected @Nullable net.minecraft.entity.Entity entity
    • entityTypeName

      @Nullable protected @Nullable net.minecraft.client.font.MultilineText entityTypeName
    • entityErrorState

      protected boolean entityErrorState
    • entityTextX

      protected int entityTextX
      The cached center XY coordinates for rendering the entity. tY is for text.
    • entityTextY

      protected int entityTextY
      The cached center XY coordinates for rendering the entity. tY is for text.
    • entityDisplaySize

      protected int entityDisplaySize
      The cached calculated size at which the entity will render.
    • entityScale

      protected double entityScale
    • followsCursor

      protected boolean followsCursor
    • EntityGuiSizeOffsets

      public static final Map<net.minecraft.entity.EntityType<?>,Supplier<Double>> EntityGuiSizeOffsets
      Contains a set of size offsets to apply to entities rendered on the screen with the TEntityRendererElement.
  • Constructor Details

    • TEntityRendererElement

      public TEntityRendererElement(int x, int y, int width, int height)
    • TEntityRendererElement

      public TEntityRendererElement(int x, int y, int width, int height, net.minecraft.entity.EntityType<?> entityType)
  • Method Details

    • setSize

      public void setSize(int width, int height, int flags)
      Overrides:
      setSize in class TElement
    • getEntity

      @Nullable public final @Nullable net.minecraft.entity.Entity getEntity()
    • getEntityType

      @Nullable public final @Nullable net.minecraft.entity.EntityType<?> getEntityType()
    • setEntity

      public final void setEntity(@Nullable @Nullable net.minecraft.entity.EntityType<?> entityType)
    • setEntity

      public final void setEntity(@Nullable @Nullable net.minecraft.entity.Entity entity)
    • updateEntityTypeName

      @Internal protected final void updateEntityTypeName(net.minecraft.entity.EntityType<?> entityType)
    • getFollowsCursor

      public final boolean getFollowsCursor()
    • setFollowsCursor

      public void setFollowsCursor(boolean followsCursor)
    • getEntityScale

      public final double getEntityScale()
    • setEntityScale

      public final void setEntityScale(double entityScale)
    • recalcCache_mobSize

      protected final void recalcCache_mobSize()
      Recalculates the value of entityDisplaySize.
    • recalcCache_cXY

      protected final void recalcCache_cXY()
      Recalculates the values of entityTextX and entityTextY.
    • render

      public void render(TDrawContext pencil)
      Description copied from interface: TParentElement
      Renders this GUI element on the screen.
      Specified by:
      render in interface TParentElement
      Overrides:
      render in class TBlankElement
      Parameters:
      pencil - The TDrawContext.
    • getEntityGuiSizeOffset

      public static double getEntityGuiSizeOffset(net.minecraft.entity.EntityType<?> entityType)
      Returns an entity size offset using EntityGuiSizeOffsets for when an entity is rendered using TEntityRendererElement.
    • calculateEntityGUISize

      public static int calculateEntityGUISize(net.minecraft.entity.Entity entity, int viewportSize)
      Calculates the GUI Entity size given the viewport size and the entity rendering size offsets.
      Parameters:
      entity - The target Entity
      viewportSize - The smallest viewport size, be it the width or the height.