BabyHorseModel.java

net.minecraft.client.model.animal.equine.BabyHorseModel

信息

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

    TODO

字段/常量

内部类/嵌套类型

构造器

public BabyHorseModel(ModelPart root) @ L15

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

参数:

  • root: ModelPart

说明:

TODO

方法

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

public static MeshDefinition createBabyMesh(CubeDeformation g) @ L19

  • 方法名:createBabyMesh
  • 源码定位:L19
  • 返回类型:MeshDefinition
  • 修饰符:public static

参数:

  • g: CubeDeformation

说明:

TODO

protected float getLegStandingYOffset() @ L63

  • 方法名:getLegStandingYOffset
  • 源码定位:L63
  • 返回类型:float
  • 修饰符:protected

参数:

说明:

TODO

protected float getLegStandingZOffset() @ L68

  • 方法名:getLegStandingZOffset
  • 源码定位:L68
  • 返回类型:float
  • 修饰符:protected

参数:

说明:

TODO

protected float getTailXRotOffset() @ L73

  • 方法名:getTailXRotOffset
  • 源码定位:L73
  • 返回类型:float
  • 修饰符:protected

参数:

说明:

TODO

protected void animateHeadPartsPlacement(float eating, float standing) @ L78

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

参数:

  • eating: float
  • standing: float

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class BabyHorseModel extends HorseModel {
    public BabyHorseModel(ModelPart root) {
        super(root);
    }
 
    public static MeshDefinition createBabyMesh(CubeDeformation g) {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        PartDefinition Body = root.addOrReplaceChild(
            "body", CubeListBuilder.create().texOffs(0, 13).addBox(-4.0F, -3.5F, -7.0F, 8.0F, 7.0F, 14.0F, g), PartPose.offset(0.0F, 12.5F, 0.0F)
        );
        Body.addOrReplaceChild(
            "tail",
            CubeListBuilder.create().texOffs(24, 34).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 3.0F, 8.0F, g),
            PartPose.offsetAndRotation(0.0F, -1.0F, 7.0F, -0.7418F, 0.0F, 0.0F)
        );
        root.addOrReplaceChild(
            "left_hind_leg", CubeListBuilder.create().texOffs(12, 46).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 9.0F, 3.0F, g), PartPose.offset(2.4F, 16.0F, 5.4F)
        );
        root.addOrReplaceChild(
            "right_hind_leg", CubeListBuilder.create().texOffs(0, 46).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 9.0F, 3.0F, g), PartPose.offset(-2.4F, 16.0F, 5.4F)
        );
        root.addOrReplaceChild(
            "left_front_leg", CubeListBuilder.create().texOffs(12, 34).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 9.0F, 3.0F, g), PartPose.offset(2.4F, 16.0F, -5.4F)
        );
        root.addOrReplaceChild(
            "right_front_leg", CubeListBuilder.create().texOffs(0, 34).addBox(-1.5F, -1.0F, -1.5F, 3.0F, 9.0F, 3.0F, g), PartPose.offset(-2.4F, 16.0F, -5.4F)
        );
        PartDefinition neck = root.addOrReplaceChild(
            "head_parts",
            CubeListBuilder.create().texOffs(30, 0).addBox(-2.0F, -6.0F, -2.0F, 4.0F, 8.0F, 4.0F, g),
            PartPose.offsetAndRotation(0.0F, 10.0F, -6.0F, 0.6109F, 0.0F, 0.0F)
        );
        PartDefinition head = neck.addOrReplaceChild(
            "head", CubeListBuilder.create().texOffs(0, 0).addBox(-3.0F, -3.9484F, -6.705F, 6.0F, 4.0F, 9.0F, g), PartPose.offset(0.0F, -6.0516F, -0.2951F)
        );
        head.addOrReplaceChild(
            "left_ear",
            CubeListBuilder.create().texOffs(0, 4).addBox(-1.0F, -2.5F, -0.8F, 2.0F, 3.0F, 1.0F, g),
            PartPose.offsetAndRotation(2.0F, -4.2484F, 1.9451F, 0.0F, 0.0F, 0.2618F)
        );
        head.addOrReplaceChild(
            "right_ear",
            CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -2.5F, -0.5F, 2.0F, 3.0F, 1.0F, g),
            PartPose.offsetAndRotation(-2.0F, -4.2484F, 1.645F, 0.0F, 0.0F, -0.2618F)
        );
        return mesh;
    }
 
    @Override
    protected float getLegStandingYOffset() {
        return 4.0F;
    }
 
    @Override
    protected float getLegStandingZOffset() {
        return 0.0F;
    }
 
    @Override
    protected float getTailXRotOffset() {
        return (float) (-Math.PI / 2);
    }
 
    @Override
    protected void animateHeadPartsPlacement(float eating, float standing) {
        this.headParts.y = this.headParts.y + Mth.lerp(eating, Mth.lerp(standing, 0.0F, -2.0F), 2.0F);
        this.headParts.z = Mth.lerp(standing, this.headParts.z, -4.0F);
    }
}

引用的其他类

  • HorseModel

    • 引用位置: 继承
  • ModelPart

    • 引用位置: 参数
  • PartPose

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

    • 引用位置: 参数
  • CubeListBuilder

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

    • 引用位置: 构造调用/返回值
    • 关联成员: MeshDefinition()
  • Mth

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