Class LivingEntityRenderer<T extends LivingEntity,​M extends EntityModel<T>>

java.lang.Object
net.minecraft.client.render.entity.EntityRenderer<T>
net.minecraft.client.render.entity.LivingEntityRenderer<T,​M>
All Implemented Interfaces:
FeatureRendererContext<T,​M>
Direct Known Subclasses:
ArmorStandEntityRenderer, MobEntityRenderer, PlayerEntityRenderer

@Environment(CLIENT)
public abstract class LivingEntityRenderer<T extends LivingEntity,​M extends EntityModel<T>>
extends EntityRenderer<T>
implements FeatureRendererContext<T,​M>
  • Field Details

  • Constructor Details

    • LivingEntityRenderer

      public LivingEntityRenderer​(EntityRenderDispatcher dispatcher, M model, float shadowRadius)
  • Method Details

    • addFeature

      protected final boolean addFeature​(FeatureRenderer<T,​M> feature)
    • getModel

      public M getModel()
      Specified by:
      getModel in interface FeatureRendererContext<T extends LivingEntity,​M extends EntityModel<T>>
    • render

      public void render​(T t, float float2, float float3, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int int2)
      Overrides:
      render in class EntityRenderer<T extends LivingEntity>
    • getRenderLayer

      @Nullable protected RenderLayer getRenderLayer​(T entity, boolean showBody, boolean translucent, boolean showOutline)
      Gets the render layer appropriate for rendering the passed entity. Returns null if the entity should not be rendered.
    • getOverlay

      public static int getOverlay​(LivingEntity entity, float whiteOverlayProgress)
      Returns the packed overlay color for an entity, determined by its death progress and whether it is flashing.
    • isVisible

      protected boolean isVisible​(T entity)
    • getYaw

      private static float getYaw​(Direction direction)
    • isShaking

      protected boolean isShaking​(T entity)
      Returns if this entity is shaking in the way a zombie villager, zombie, husk, or piglin undergoing conversion shakes. husk, or piglin are undergoing conversion.
    • setupTransforms

      protected void setupTransforms​(T entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta)
    • getHandSwingProgress

      protected float getHandSwingProgress​(T entity, float tickDelta)
    • getAnimationProgress

      protected float getAnimationProgress​(T entity, float tickDelta)
      This value is passed to other methods when calculating angles for animation. It's typically just the sum of the entity's age (in ticks) and the passed in tickDelta.
    • getLyingAngle

      protected float getLyingAngle​(T entity)
    • getAnimationCounter

      protected float getAnimationCounter​(T entity, float tickDelta)
    • scale

      protected void scale​(T entity, MatrixStack matrices, float amount)
    • hasLabel

      protected boolean hasLabel​(T t)
      Description copied from class: EntityRenderer
      Determines whether the passed entity should render with a nameplate above its head.

      Checks for a custom nametag on living entities, and for teams/team visibilities for players.

      Overrides:
      hasLabel in class EntityRenderer<T extends LivingEntity>