LlamaModel.java
net.minecraft.client.model.animal.llama.LlamaModel
信息
- 全限定名:net.minecraft.client.model.animal.llama.LlamaModel
- 类型:public class
- 包:net.minecraft.client.model.animal.llama
- 源码路径:src/main/java/net/minecraft/client/model/animal/llama/LlamaModel.java
- 起始行号:L17
- 继承:EntityModel
- 职责:
TODO
字段/常量
-
head- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L18 - 说明:
TODO
- 类型:
-
rightHindLeg- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L19 - 说明:
TODO
- 类型:
-
leftHindLeg- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L20 - 说明:
TODO
- 类型:
-
rightFrontLeg- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L21 - 说明:
TODO
- 类型:
-
leftFrontLeg- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L22 - 说明:
TODO
- 类型:
-
rightChest- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L23 - 说明:
TODO
- 类型:
-
leftChest- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L24 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public LlamaModel(ModelPart root) @ L26
- 构造器名:LlamaModel
- 源码定位:L26
- 修饰符:public
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static LayerDefinition createBodyLayer(CubeDeformation g) @ L37
- 方法名:createBodyLayer
- 源码定位:L37
- 返回类型:LayerDefinition
- 修饰符:public static
参数:
- g: CubeDeformation
说明:
TODO
public void setupAnim(LlamaRenderState state) @ L78
- 方法名:setupAnim
- 源码定位:L78
- 返回类型:void
- 修饰符:public
参数:
- state: LlamaRenderState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class LlamaModel extends EntityModel<LlamaRenderState> {
private final ModelPart head;
private final ModelPart rightHindLeg;
private final ModelPart leftHindLeg;
private final ModelPart rightFrontLeg;
private final ModelPart leftFrontLeg;
private final ModelPart rightChest;
private final ModelPart leftChest;
public LlamaModel(ModelPart root) {
super(root);
this.head = root.getChild("head");
this.rightChest = root.getChild("right_chest");
this.leftChest = root.getChild("left_chest");
this.rightHindLeg = root.getChild("right_hind_leg");
this.leftHindLeg = root.getChild("left_hind_leg");
this.rightFrontLeg = root.getChild("right_front_leg");
this.leftFrontLeg = root.getChild("left_front_leg");
}
public static LayerDefinition createBodyLayer(CubeDeformation g) {
MeshDefinition mesh = new MeshDefinition();
PartDefinition root = mesh.getRoot();
root.addOrReplaceChild(
"head",
CubeListBuilder.create()
.texOffs(0, 0)
.addBox(-2.0F, -14.0F, -10.0F, 4.0F, 4.0F, 9.0F, g)
.texOffs(0, 14)
.addBox("neck", -4.0F, -16.0F, -6.0F, 8.0F, 18.0F, 6.0F, g)
.texOffs(17, 0)
.addBox("ear", -4.0F, -19.0F, -4.0F, 3.0F, 3.0F, 2.0F, g)
.texOffs(17, 0)
.addBox("ear", 1.0F, -19.0F, -4.0F, 3.0F, 3.0F, 2.0F, g),
PartPose.offset(0.0F, 7.0F, -6.0F)
);
root.addOrReplaceChild(
"body",
CubeListBuilder.create().texOffs(29, 0).addBox(-6.0F, -10.0F, -7.0F, 12.0F, 18.0F, 10.0F, g),
PartPose.offsetAndRotation(0.0F, 5.0F, 2.0F, (float) (Math.PI / 2), 0.0F, 0.0F)
);
root.addOrReplaceChild(
"right_chest",
CubeListBuilder.create().texOffs(45, 28).addBox(-3.0F, 0.0F, 0.0F, 8.0F, 8.0F, 3.0F, g),
PartPose.offsetAndRotation(-8.5F, 3.0F, 3.0F, 0.0F, (float) (Math.PI / 2), 0.0F)
);
root.addOrReplaceChild(
"left_chest",
CubeListBuilder.create().texOffs(45, 41).addBox(-3.0F, 0.0F, 0.0F, 8.0F, 8.0F, 3.0F, g),
PartPose.offsetAndRotation(5.5F, 3.0F, 3.0F, 0.0F, (float) (Math.PI / 2), 0.0F)
);
int legWidth = 4;
int legHeight = 14;
CubeListBuilder leg = CubeListBuilder.create().texOffs(29, 29).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 14.0F, 4.0F, g);
root.addOrReplaceChild("right_hind_leg", leg, PartPose.offset(-3.5F, 10.0F, 6.0F));
root.addOrReplaceChild("left_hind_leg", leg, PartPose.offset(3.5F, 10.0F, 6.0F));
root.addOrReplaceChild("right_front_leg", leg, PartPose.offset(-3.5F, 10.0F, -5.0F));
root.addOrReplaceChild("left_front_leg", leg, PartPose.offset(3.5F, 10.0F, -5.0F));
return LayerDefinition.create(mesh, 128, 64);
}
public void setupAnim(LlamaRenderState state) {
super.setupAnim(state);
this.head.xRot = state.xRot * (float) (Math.PI / 180.0);
this.head.yRot = state.yRot * (float) (Math.PI / 180.0);
float animationSpeed = state.walkAnimationSpeed;
float animationPos = state.walkAnimationPos;
this.rightHindLeg.xRot = Mth.cos(animationPos * 0.6662F) * 1.4F * animationSpeed;
this.leftHindLeg.xRot = Mth.cos(animationPos * 0.6662F + (float) Math.PI) * 1.4F * animationSpeed;
this.rightFrontLeg.xRot = Mth.cos(animationPos * 0.6662F + (float) Math.PI) * 1.4F * animationSpeed;
this.leftFrontLeg.xRot = Mth.cos(animationPos * 0.6662F) * 1.4F * animationSpeed;
this.rightChest.visible = state.hasChest;
this.leftChest.visible = state.hasChest;
}
}引用的其他类
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offset(), PartPose.offsetAndRotation()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
MeshDefinition()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Mth.cos()
- 引用位置: