RaftModel.java

net.minecraft.client.model.object.boat.RaftModel

信息

  • 全限定名:net.minecraft.client.model.object.boat.RaftModel
  • 类型:public class
  • 包:net.minecraft.client.model.object.boat
  • 源码路径:src/main/java/net/minecraft/client/model/object/boat/RaftModel.java
  • 起始行号:L13
  • 继承:AbstractBoatModel
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

构造器

public RaftModel(ModelPart root) @ L14

  • 构造器名:RaftModel
  • 源码定位:L14
  • 修饰符:public

参数:

  • root: ModelPart

说明:

TODO

方法

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

private static void addCommonParts(PartDefinition root) @ L18

  • 方法名:addCommonParts
  • 源码定位:L18
  • 返回类型:void
  • 修饰符:private static

参数:

  • root: PartDefinition

说明:

TODO

public static LayerDefinition createRaftModel() @ L44

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

参数:

说明:

TODO

public static LayerDefinition createChestRaftModel() @ L51

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

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class RaftModel extends AbstractBoatModel {
    public RaftModel(ModelPart root) {
        super(root);
    }
 
    private static void addCommonParts(PartDefinition root) {
        root.addOrReplaceChild(
            "bottom",
            CubeListBuilder.create()
                .texOffs(0, 0)
                .addBox(-14.0F, -11.0F, -4.0F, 28.0F, 20.0F, 4.0F)
                .texOffs(0, 0)
                .addBox(-14.0F, -9.0F, -8.0F, 28.0F, 16.0F, 4.0F),
            PartPose.offsetAndRotation(0.0F, -2.1F, 1.0F, 1.5708F, 0.0F, 0.0F)
        );
        int totalLength = 20;
        int bladeLength = 7;
        int bladeWidth = 6;
        float pivot = -5.0F;
        root.addOrReplaceChild(
            "left_paddle",
            CubeListBuilder.create().texOffs(0, 24).addBox(-1.0F, 0.0F, -5.0F, 2.0F, 2.0F, 18.0F).addBox(-1.001F, -3.0F, 8.0F, 1.0F, 6.0F, 7.0F),
            PartPose.offsetAndRotation(3.0F, -4.0F, 9.0F, 0.0F, 0.0F, (float) (Math.PI / 16))
        );
        root.addOrReplaceChild(
            "right_paddle",
            CubeListBuilder.create().texOffs(40, 24).addBox(-1.0F, 0.0F, -5.0F, 2.0F, 2.0F, 18.0F).addBox(0.001F, -3.0F, 8.0F, 1.0F, 6.0F, 7.0F),
            PartPose.offsetAndRotation(3.0F, -4.0F, -9.0F, 0.0F, (float) Math.PI, (float) (Math.PI / 16))
        );
    }
 
    public static LayerDefinition createRaftModel() {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        addCommonParts(root);
        return LayerDefinition.create(mesh, 128, 64);
    }
 
    public static LayerDefinition createChestRaftModel() {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        addCommonParts(root);
        root.addOrReplaceChild(
            "chest_bottom",
            CubeListBuilder.create().texOffs(0, 76).addBox(0.0F, 0.0F, 0.0F, 12.0F, 8.0F, 12.0F),
            PartPose.offsetAndRotation(-2.0F, -10.1F, -6.0F, 0.0F, (float) (-Math.PI / 2), 0.0F)
        );
        root.addOrReplaceChild(
            "chest_lid",
            CubeListBuilder.create().texOffs(0, 59).addBox(0.0F, 0.0F, 0.0F, 12.0F, 4.0F, 12.0F),
            PartPose.offsetAndRotation(-2.0F, -14.1F, -6.0F, 0.0F, (float) (-Math.PI / 2), 0.0F)
        );
        root.addOrReplaceChild(
            "chest_lock",
            CubeListBuilder.create().texOffs(0, 59).addBox(0.0F, 0.0F, 0.0F, 2.0F, 4.0F, 1.0F),
            PartPose.offsetAndRotation(-1.0F, -11.1F, -1.0F, 0.0F, (float) (-Math.PI / 2), 0.0F)
        );
        return LayerDefinition.create(mesh, 128, 128);
    }
}

引用的其他类