BabyPandaModel.java

net.minecraft.client.model.animal.panda.BabyPandaModel

信息

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

    TODO

字段/常量

内部类/嵌套类型

构造器

public BabyPandaModel(ModelPart root) @ L16

  • 构造器名:BabyPandaModel
  • 源码定位:L16
  • 修饰符:public

参数:

  • root: ModelPart

说明:

TODO

方法

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

public static LayerDefinition createBodyLayer() @ L20

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

参数:

说明:

TODO

protected void animateSitting(PandaRenderState state) @ L54

  • 方法名:animateSitting
  • 源码定位:L54
  • 返回类型:void
  • 修饰符:protected

参数:

  • state: PandaRenderState

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class BabyPandaModel extends PandaModel {
    public BabyPandaModel(ModelPart root) {
        super(root);
    }
 
    public static LayerDefinition createBodyLayer() {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        root.addOrReplaceChild(
            "body", CubeListBuilder.create().texOffs(0, 11).addBox(-4.5F, -3.5F, -5.5F, 9.0F, 7.0F, 11.0F), PartPose.offset(0.0F, 18.5F, 2.5F)
        );
        root.addOrReplaceChild(
            "head",
            CubeListBuilder.create()
                .texOffs(0, 0)
                .addBox(-3.5F, -3.0F, -5.0F, 7.0F, 6.0F, 5.0F)
                .texOffs(24, 6)
                .addBox(-2.0F, 1.0F, -6.0F, 4.0F, 2.0F, 1.0F)
                .texOffs(24, 0)
                .addBox(-4.5F, -4.0F, -3.5F, 3.0F, 3.0F, 1.0F)
                .texOffs(33, 0)
                .addBox(1.5F, -4.0F, -3.5F, 3.0F, 3.0F, 1.0F),
            PartPose.offset(0.0F, 19.0F, -3.0F)
        );
        root.addOrReplaceChild(
            "right_hind_leg", CubeListBuilder.create().texOffs(0, 34).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 2.0F, 3.0F), PartPose.offset(-3.0F, 22.0F, 6.5F)
        );
        root.addOrReplaceChild(
            "left_hind_leg", CubeListBuilder.create().texOffs(12, 34).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 2.0F, 3.0F), PartPose.offset(3.0F, 22.0F, 6.5F)
        );
        root.addOrReplaceChild(
            "right_front_leg", CubeListBuilder.create().texOffs(0, 29).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 2.0F, 3.0F), PartPose.offset(-3.0F, 22.0F, -1.5F)
        );
        root.addOrReplaceChild(
            "left_front_leg", CubeListBuilder.create().texOffs(12, 29).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 2.0F, 3.0F), PartPose.offset(3.0F, 22.0F, -1.5F)
        );
        return LayerDefinition.create(mesh, 64, 64);
    }
 
    @Override
    protected void animateSitting(PandaRenderState state) {
        this.body.xRot = Mth.rotLerpRad(state.sitAmount, this.body.xRot, (float) (Math.PI / 18));
        this.body.z = Mth.lerp(state.sitAmount, this.body.z, -1.5F);
        this.head.z = Mth.lerp(state.sitAmount, this.head.z, -11.5F);
        this.head.y = Mth.lerp(state.sitAmount, this.head.y, 17.5F);
        this.rightFrontLeg.z = Mth.lerp(state.sitAmount, this.rightFrontLeg.z, -5.0F);
        this.leftFrontLeg.z = Mth.lerp(state.sitAmount, this.leftFrontLeg.z, -5.0F);
        this.rightHindLeg.z = Mth.lerp(state.sitAmount, this.rightHindLeg.z, 3.0F);
        this.leftHindLeg.z = Mth.lerp(state.sitAmount, this.leftHindLeg.z, 3.0F);
        this.rightFrontLeg.zRot = -0.27079642F;
        this.leftFrontLeg.zRot = 0.27079642F;
        this.rightHindLeg.zRot = 0.5707964F;
        this.leftHindLeg.zRot = -0.5707964F;
    }
}

引用的其他类

  • PandaModel

    • 引用位置: 继承
  • ModelPart

    • 引用位置: 参数
  • PartPose

    • 引用位置: 方法调用
    • 关联成员: PartPose.offset()
  • CubeListBuilder

    • 引用位置: 方法调用
    • 关联成员: CubeListBuilder.create()
  • LayerDefinition

    • 引用位置: 方法调用/返回值
    • 关联成员: LayerDefinition.create()
  • MeshDefinition

    • 引用位置: 构造调用
    • 关联成员: MeshDefinition()
  • PandaRenderState

    • 引用位置: 参数
  • Mth

    • 引用位置: 方法调用
    • 关联成员: Mth.lerp(), Mth.rotLerpRad()