BabyAxolotlModel.java

net.minecraft.client.model.animal.axolotl.BabyAxolotlModel

信息

  • 全限定名:net.minecraft.client.model.animal.axolotl.BabyAxolotlModel
  • 类型:public class
  • 包:net.minecraft.client.model.animal.axolotl
  • 源码路径:src/main/java/net/minecraft/client/model/animal/axolotl/BabyAxolotlModel.java
  • 起始行号:L18
  • 继承:EntityModel
  • 职责:

    TODO

字段/常量

  • MAX_WALK_ANIMATION_SPEED

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

      TODO

  • WALK_ANIMATION_SCALE_FACTOR

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

      TODO

  • walkAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L21
    • 说明:

      TODO

  • walkUnderwaterAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L22
    • 说明:

      TODO

  • swimAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L23
    • 说明:

      TODO

  • idleOnGroundAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L24
    • 说明:

      TODO

  • idleOnGroundUnderWaterAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L25
    • 说明:

      TODO

  • idleUnderWaterAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L26
    • 说明:

      TODO

  • playDeadAnimation

    • 类型: KeyframeAnimation
    • 修饰符: private final
    • 源码定位: L27
    • 说明:

      TODO

内部类/嵌套类型

构造器

public BabyAxolotlModel(ModelPart root) @ L29

  • 构造器名:BabyAxolotlModel
  • 源码定位:L29
  • 修饰符:public

参数:

  • root: ModelPart

说明:

TODO

方法

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

public static LayerDefinition createBodyLayer() @ L40

  • 方法名:createBodyLayer
  • 源码定位:L40
  • 返回类型:LayerDefinition
  • 修饰符:public static

参数:

说明:

TODO

public void setupAnim(AxolotlRenderState state) @ L104

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

参数:

  • state: AxolotlRenderState

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class BabyAxolotlModel extends EntityModel<AxolotlRenderState> {
    private static final float MAX_WALK_ANIMATION_SPEED = 15.0F;
    private static final float WALK_ANIMATION_SCALE_FACTOR = 30.0F;
    private final KeyframeAnimation walkAnimation;
    private final KeyframeAnimation walkUnderwaterAnimation;
    private final KeyframeAnimation swimAnimation;
    private final KeyframeAnimation idleOnGroundAnimation;
    private final KeyframeAnimation idleOnGroundUnderWaterAnimation;
    private final KeyframeAnimation idleUnderWaterAnimation;
    private final KeyframeAnimation playDeadAnimation;
 
    public BabyAxolotlModel(ModelPart root) {
        super(root);
        this.swimAnimation = BabyAxolotlAnimation.BABY_AXOLOTL_SWIM.bake(root);
        this.walkAnimation = BabyAxolotlAnimation.AXOLOTL_WALK_FLOOR.bake(root);
        this.walkUnderwaterAnimation = BabyAxolotlAnimation.WALK_FLOOR_UNDERWATER.bake(root);
        this.idleUnderWaterAnimation = BabyAxolotlAnimation.IDLE_UNDERWATER.bake(root);
        this.idleOnGroundUnderWaterAnimation = BabyAxolotlAnimation.IDLE_FLOOR_UNDERWATER.bake(root);
        this.idleOnGroundAnimation = BabyAxolotlAnimation.BABY_AXOLOTL_IDLE_FLOOR.bake(root);
        this.playDeadAnimation = BabyAxolotlAnimation.BABY_AXOLOTL_PLAY_DEAD.bake(root);
    }
 
    public static LayerDefinition createBodyLayer() {
        MeshDefinition meshdefinition = new MeshDefinition();
        PartDefinition partdefinition = meshdefinition.getRoot();
        PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
        PartDefinition body = root.addOrReplaceChild(
            "body",
            CubeListBuilder.create()
                .texOffs(0, 0)
                .addBox(-2.0F, -0.75F, -2.75F, 4.0F, 2.0F, 6.0F, new CubeDeformation(0.0F))
                .texOffs(0, 12)
                .addBox(0.0F, -1.75F, -2.75F, 0.0F, 3.0F, 5.0F, new CubeDeformation(0.0F)),
            PartPose.offset(0.0F, -1.25F, 1.75F)
        );
        body.addOrReplaceChild(
            "right_front_leg",
            CubeListBuilder.create().texOffs(20, 16).addBox(-3.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
            PartPose.offset(-2.0F, 0.25F, -1.25F)
        );
        PartDefinition right_leg = body.addOrReplaceChild(
            "right_hind_leg", CubeListBuilder.create(), PartPose.offsetAndRotation(-2.0F, 0.25F, 1.75F, 0.0F, 1.5708F, 1.5708F)
        );
        right_leg.addOrReplaceChild(
            "right_leg_r1",
            CubeListBuilder.create().texOffs(20, 14).addBox(0.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
            PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -1.5708F, 0.0F, 1.5708F)
        );
        body.addOrReplaceChild(
            "left_front_leg",
            CubeListBuilder.create().texOffs(20, 13).addBox(0.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
            PartPose.offset(2.0F, 0.25F, -1.25F)
        );
        body.addOrReplaceChild(
            "left_hind_leg",
            CubeListBuilder.create().texOffs(20, 14).addBox(0.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
            PartPose.offset(2.0F, 0.25F, 1.75F)
        );
        body.addOrReplaceChild(
            "tail",
            CubeListBuilder.create().texOffs(10, 9).addBox(0.0F, -1.5F, -1.0F, 0.0F, 3.0F, 8.0F, new CubeDeformation(0.0F)),
            PartPose.offset(0.0F, -0.25F, 3.25F)
        );
        PartDefinition head = body.addOrReplaceChild(
            "head",
            CubeListBuilder.create().texOffs(0, 8).addBox(-3.0F, -2.0F, -4.0F, 6.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)),
            PartPose.offset(0.0F, 0.25F, -2.75F)
        );
        head.addOrReplaceChild(
            "left_gills",
            CubeListBuilder.create().texOffs(20, 8).addBox(0.0F, -3.5F, 0.0F, 3.0F, 5.0F, 0.0F, new CubeDeformation(0.0F)),
            PartPose.offset(3.0F, -0.5F, -2.0F)
        );
        head.addOrReplaceChild(
            "right_gills",
            CubeListBuilder.create().texOffs(20, 3).addBox(-3.0F, -3.5F, 0.0F, 3.0F, 5.0F, 0.0F, new CubeDeformation(0.0F)),
            PartPose.offset(-3.0F, -0.5F, -2.0F)
        );
        head.addOrReplaceChild(
            "top_gills",
            CubeListBuilder.create().texOffs(20, 0).addBox(-3.0F, -3.0F, 0.0F, 6.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)),
            PartPose.offset(0.0F, -2.0F, -2.0F)
        );
        return LayerDefinition.create(meshdefinition, 32, 32);
    }
 
    public void setupAnim(AxolotlRenderState state) {
        super.setupAnim(state);
        if (state.walkAnimationState.isStarted()) {
            this.walkAnimation.applyWalk(state.walkAnimationPos, state.walkAnimationSpeed, 15.0F, 30.0F);
        }
 
        this.swimAnimation.apply(state.swimAnimation, state.ageInTicks);
        this.walkUnderwaterAnimation.apply(state.walkAnimationState, state.ageInTicks);
        this.idleOnGroundAnimation.apply(state.idleOnGroundAnimationState, state.ageInTicks);
        this.idleUnderWaterAnimation.apply(state.idleUnderWaterAnimationState, state.ageInTicks);
        this.idleOnGroundUnderWaterAnimation.apply(state.idleUnderWaterOnGroundAnimationState, state.ageInTicks);
        this.playDeadAnimation.apply(state.playDeadAnimationState, state.ageInTicks);
    }
}

引用的其他类