AdultWolfModel.java

net.minecraft.client.model.animal.wolf.AdultWolfModel

信息

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

    TODO

字段/常量

  • REAL_HEAD

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

      TODO

  • UPPER_BODY

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

      TODO

  • REAL_TAIL

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

      TODO

  • realHead

    • 类型: ModelPart
    • 修饰符: private final
    • 源码定位: L18
    • 说明:

      TODO

  • realTail

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

      TODO

  • upperBody

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

      TODO

  • LEG_SIZE

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

      TODO

内部类/嵌套类型

构造器

public AdultWolfModel(ModelPart root) @ L23

  • 构造器名:AdultWolfModel
  • 源码定位:L23
  • 修饰符:public

参数:

  • root: ModelPart

说明:

TODO

方法

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

public static MeshDefinition createBodyLayer(CubeDeformation g) @ L29

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

参数:

  • g: CubeDeformation

说明:

TODO

protected void setSittingPose(WolfRenderState state) @ L70

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

参数:

  • state: WolfRenderState

说明:

TODO

protected void shakeOffWater(WolfRenderState state) @ L78

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

参数:

  • state: WolfRenderState

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class AdultWolfModel extends WolfModel {
    private static final String REAL_HEAD = "real_head";
    private static final String UPPER_BODY = "upper_body";
    private static final String REAL_TAIL = "real_tail";
    private final ModelPart realHead = this.head.getChild("real_head");
    private final ModelPart realTail;
    private final ModelPart upperBody;
    private static final int LEG_SIZE = 8;
 
    public AdultWolfModel(ModelPart root) {
        super(root);
        this.upperBody = root.getChild("upper_body");
        this.realTail = this.tail.getChild("real_tail");
    }
 
    public static MeshDefinition createBodyLayer(CubeDeformation g) {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        float headHeight = 13.5F;
        PartDefinition head = root.addOrReplaceChild("head", CubeListBuilder.create(), PartPose.offset(-1.0F, 13.5F, -7.0F));
        head.addOrReplaceChild(
            "real_head",
            CubeListBuilder.create()
                .texOffs(0, 0)
                .addBox(-2.0F, -3.0F, -2.0F, 6.0F, 6.0F, 4.0F, g)
                .texOffs(16, 14)
                .addBox(-2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, g)
                .texOffs(16, 14)
                .addBox(2.0F, -5.0F, 0.0F, 2.0F, 2.0F, 1.0F, g)
                .texOffs(0, 10)
                .addBox(-0.5F, -0.001F, -5.0F, 3.0F, 3.0F, 4.0F, g),
            PartPose.ZERO
        );
        root.addOrReplaceChild(
            "body",
            CubeListBuilder.create().texOffs(18, 14).addBox(-3.0F, -2.0F, -3.0F, 6.0F, 9.0F, 6.0F, g),
            PartPose.offsetAndRotation(0.0F, 14.0F, 2.0F, (float) (Math.PI / 2), 0.0F, 0.0F)
        );
        root.addOrReplaceChild(
            "upper_body",
            CubeListBuilder.create().texOffs(21, 0).addBox(-3.0F, -3.0F, -3.0F, 8.0F, 6.0F, 7.0F, g),
            PartPose.offsetAndRotation(-1.0F, 14.0F, -3.0F, (float) (Math.PI / 2), 0.0F, 0.0F)
        );
        CubeListBuilder leftLeg = CubeListBuilder.create().texOffs(0, 18).addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, g);
        CubeListBuilder rightLeg = CubeListBuilder.create().mirror().texOffs(0, 18).addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, g);
        root.addOrReplaceChild("right_hind_leg", rightLeg, PartPose.offset(-2.5F, 16.0F, 7.0F));
        root.addOrReplaceChild("left_hind_leg", leftLeg, PartPose.offset(0.5F, 16.0F, 7.0F));
        root.addOrReplaceChild("right_front_leg", rightLeg, PartPose.offset(-2.5F, 16.0F, -4.0F));
        root.addOrReplaceChild("left_front_leg", leftLeg, PartPose.offset(0.5F, 16.0F, -4.0F));
        PartDefinition tail = root.addOrReplaceChild(
            "tail", CubeListBuilder.create(), PartPose.offsetAndRotation(-1.0F, 12.0F, 8.0F, (float) (Math.PI / 5), 0.0F, 0.0F)
        );
        tail.addOrReplaceChild("real_tail", CubeListBuilder.create().texOffs(9, 18).addBox(0.0F, 0.0F, -1.0F, 2.0F, 8.0F, 2.0F, g), PartPose.ZERO);
        return mesh;
    }
 
    @Override
    protected void setSittingPose(WolfRenderState state) {
        super.setSittingPose(state);
        this.upperBody.y += 2.0F;
        this.upperBody.xRot = (float) (Math.PI * 2.0 / 5.0);
        this.upperBody.yRot = 0.0F;
    }
 
    @Override
    protected void shakeOffWater(WolfRenderState state) {
        super.shakeOffWater(state);
        this.realHead.zRot = state.headRollAngle + state.getBodyRollAngle(0.0F);
        this.upperBody.zRot = state.getBodyRollAngle(-0.08F);
        this.realTail.zRot = state.getBodyRollAngle(-0.2F);
    }
}

引用的其他类