ArmadilloRenderer.java

net.minecraft.client.renderer.entity.ArmadilloRenderer

信息

  • 全限定名:net.minecraft.client.renderer.entity.ArmadilloRenderer
  • 类型:public class
  • 包:net.minecraft.client.renderer.entity
  • 源码路径:src/main/java/net/minecraft/client/renderer/entity/ArmadilloRenderer.java
  • 起始行号:L14
  • 继承:AgeableMobRenderer<Armadillo,ArmadilloRenderState,ArmadilloModel>
  • 职责:

    TODO

字段/常量

  • ARMADILLO_LOCATION

    • 类型: Identifier
    • 修饰符: private static final
    • 源码定位: L15
    • 说明:

      TODO

  • ARMADILLO_BABY_LOCATION

    • 类型: Identifier
    • 修饰符: private static final
    • 源码定位: L16
    • 说明:

      TODO

内部类/嵌套类型

构造器

public ArmadilloRenderer(EntityRendererProvider.Context context) @ L18

  • 构造器名:ArmadilloRenderer
  • 源码定位:L18
  • 修饰符:public

参数:

  • context: EntityRendererProvider.Context

说明:

TODO

方法

下面的方法块按源码顺序生成。

public Identifier getTextureLocation(ArmadilloRenderState state) @ L27

  • 方法名:getTextureLocation
  • 源码定位:L27
  • 返回类型:Identifier
  • 修饰符:public

参数:

  • state: ArmadilloRenderState

说明:

TODO

public ArmadilloRenderState createRenderState() @ L31

  • 方法名:createRenderState
  • 源码定位:L31
  • 返回类型:ArmadilloRenderState
  • 修饰符:public

参数:

说明:

TODO

public void extractRenderState(Armadillo entity, ArmadilloRenderState state, float partialTicks) @ L35

  • 方法名:extractRenderState
  • 源码定位:L35
  • 返回类型:void
  • 修饰符:public

参数:

  • entity: Armadillo
  • state: ArmadilloRenderState
  • partialTicks: float

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class ArmadilloRenderer extends AgeableMobRenderer<Armadillo, ArmadilloRenderState, ArmadilloModel> {
    private static final Identifier ARMADILLO_LOCATION = Identifier.withDefaultNamespace("textures/entity/armadillo/armadillo.png");
    private static final Identifier ARMADILLO_BABY_LOCATION = Identifier.withDefaultNamespace("textures/entity/armadillo/armadillo_baby.png");
 
    public ArmadilloRenderer(EntityRendererProvider.Context context) {
        super(
            context,
            new AdultArmadilloModel(context.bakeLayer(ModelLayers.ARMADILLO)),
            new BabyArmadilloModel(context.bakeLayer(ModelLayers.ARMADILLO_BABY)),
            0.4F
        );
    }
 
    public Identifier getTextureLocation(ArmadilloRenderState state) {
        return state.isBaby ? ARMADILLO_BABY_LOCATION : ARMADILLO_LOCATION;
    }
 
    public ArmadilloRenderState createRenderState() {
        return new ArmadilloRenderState();
    }
 
    public void extractRenderState(Armadillo entity, ArmadilloRenderState state, float partialTicks) {
        super.extractRenderState(entity, state, partialTicks);
        state.isHidingInShell = entity.shouldHideInShell();
        state.peekAnimationState.copyFrom(entity.peekAnimationState);
        state.rollOutAnimationState.copyFrom(entity.rollOutAnimationState);
        state.rollUpAnimationState.copyFrom(entity.rollUpAnimationState);
    }
}

引用的其他类