BabyHoglinModel.java

net.minecraft.client.model.monster.hoglin.BabyHoglinModel

信息

  • 全限定名:net.minecraft.client.model.monster.hoglin.BabyHoglinModel
  • 类型:public class
  • 包:net.minecraft.client.model.monster.hoglin
  • 源码路径:src/main/java/net/minecraft/client/model/monster/hoglin/BabyHoglinModel.java
  • 起始行号:L14
  • 继承:HoglinModel
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

构造器

public BabyHoglinModel(ModelPart root) @ L15

  • 构造器名:BabyHoglinModel
  • 源码定位:L15
  • 修饰符:public

参数:

  • root: ModelPart

说明:

TODO

方法

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

protected void animateHeadbutt(float headbuttLerpFactor) @ L19

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

参数:

  • headbuttLerpFactor: float

说明:

TODO

public static LayerDefinition createBodyLayer() @ L25

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

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class BabyHoglinModel extends HoglinModel {
    public BabyHoglinModel(ModelPart root) {
        super(root);
    }
 
    @Override
    protected void animateHeadbutt(float headbuttLerpFactor) {
        super.animateHeadbutt(headbuttLerpFactor);
        this.head.y += headbuttLerpFactor * 2.5F;
    }
 
    public static LayerDefinition createBodyLayer() {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        PartDefinition head = root.addOrReplaceChild(
            "head",
            CubeListBuilder.create()
                .texOffs(0, 0)
                .addBox(-5.0F, -2.2605F, -10.547F, 10.0F, 4.0F, 12.0F)
                .texOffs(44, 29)
                .addBox(-7.0F, -4.0981F, -8.4879F, 2.0F, 5.0F, 2.0F)
                .texOffs(52, 29)
                .addBox(5.0F, -4.0981F, -8.4879F, 2.0F, 5.0F, 2.0F),
            PartPose.offsetAndRotation(0.0F, 13.0F, -7.0F, 0.8727F, 0.0F, 0.0F)
        );
        root.addOrReplaceChild(
            "body",
            CubeListBuilder.create()
                .texOffs(0, 16)
                .addBox(-4.0F, -14.0F, -7.0F, 8.0F, 8.0F, 14.0F, new CubeDeformation(0.02F))
                .texOffs(24, 39)
                .addBox(0.0F, -18.0F, -8.0F, 0.0F, 6.0F, 11.0F, new CubeDeformation(0.02F)),
            PartPose.offset(0.0F, 24.0F, 0.0F)
        );
        head.addOrReplaceChild(
            "right_ear",
            CubeListBuilder.create().texOffs(32, 5).addBox(-5.1F, -0.5F, -2.0F, 6.0F, 1.0F, 4.0F),
            PartPose.offsetAndRotation(-5.0F, -1.0F, -1.5F, 0.0F, 0.0F, -0.8727F)
        );
        head.addOrReplaceChild(
            "left_ear",
            CubeListBuilder.create().texOffs(32, 0).mirror().addBox(-0.9F, -0.5F, -2.0F, 6.0F, 1.0F, 4.0F).mirror(false),
            PartPose.offsetAndRotation(5.0F, -1.0F, -1.5F, 0.0F, 0.0F, 0.8727F)
        );
        root.addOrReplaceChild(
            "right_hind_leg", CubeListBuilder.create().texOffs(0, 47).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 6.0F, 3.0F), PartPose.offset(-2.5F, 18.0F, 4.5F)
        );
        root.addOrReplaceChild(
            "left_hind_leg", CubeListBuilder.create().texOffs(12, 47).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 6.0F, 3.0F), PartPose.offset(2.5F, 18.0F, 4.5F)
        );
        root.addOrReplaceChild(
            "right_front_leg", CubeListBuilder.create().texOffs(0, 38).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 6.0F, 3.0F), PartPose.offset(-2.5F, 18.0F, -4.5F)
        );
        root.addOrReplaceChild(
            "left_front_leg", CubeListBuilder.create().texOffs(12, 38).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 6.0F, 3.0F), PartPose.offset(2.5F, 18.0F, -4.5F)
        );
        return LayerDefinition.create(mesh, 64, 64);
    }
}

引用的其他类

  • ModelPart

    • 引用位置: 参数
  • PartPose

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

    • 引用位置: 构造调用
    • 关联成员: CubeDeformation()
  • CubeListBuilder

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

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

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

    • 引用位置: 继承