ArmorStandArmorModel.java
net.minecraft.client.model.object.armorstand.ArmorStandArmorModel
信息
- 全限定名:net.minecraft.client.model.object.armorstand.ArmorStandArmorModel
- 类型:public class
- 包:net.minecraft.client.model.object.armorstand
- 源码路径:src/main/java/net/minecraft/client/model/object/armorstand/ArmorStandArmorModel.java
- 起始行号:L17
- 继承:HumanoidModel
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
public ArmorStandArmorModel(ModelPart root) @ L18
- 构造器名:ArmorStandArmorModel
- 源码定位:L18
- 修饰符:public
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static ArmorModelSet<LayerDefinition> createArmorLayerSet(CubeDeformation innerDeformation, CubeDeformation outerDeformation) @ L22
- 方法名:createArmorLayerSet
- 源码定位:L22
- 返回类型:ArmorModelSet
- 修饰符:public static
参数:
- innerDeformation: CubeDeformation
- outerDeformation: CubeDeformation
说明:
TODO
private static MeshDefinition createBaseMesh(CubeDeformation g) @ L27
- 方法名:createBaseMesh
- 源码定位:L27
- 返回类型:MeshDefinition
- 修饰符:private static
参数:
- g: CubeDeformation
说明:
TODO
public void setupAnim(ArmorStandRenderState state) @ L47
- 方法名:setupAnim
- 源码定位:L47
- 返回类型:void
- 修饰符:public
参数:
- state: ArmorStandRenderState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class ArmorStandArmorModel extends HumanoidModel<ArmorStandRenderState> {
public ArmorStandArmorModel(ModelPart root) {
super(root);
}
public static ArmorModelSet<LayerDefinition> createArmorLayerSet(CubeDeformation innerDeformation, CubeDeformation outerDeformation) {
return createArmorMeshSet(ArmorStandArmorModel::createBaseMesh, ADULT_ARMOR_PARTS_PER_SLOT, innerDeformation, outerDeformation)
.map(mesh -> LayerDefinition.create(mesh, 64, 32));
}
private static MeshDefinition createBaseMesh(CubeDeformation g) {
MeshDefinition mesh = HumanoidModel.createMesh(g, 0.0F);
PartDefinition root = mesh.getRoot();
PartDefinition head = root.addOrReplaceChild(
"head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, g), PartPose.offset(0.0F, 1.0F, 0.0F)
);
head.addOrReplaceChild("hat", CubeListBuilder.create().texOffs(32, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, g.extend(0.5F)), PartPose.ZERO);
root.addOrReplaceChild(
"right_leg",
CubeListBuilder.create().texOffs(0, 16).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, g.extend(-0.1F)),
PartPose.offset(-1.9F, 11.0F, 0.0F)
);
root.addOrReplaceChild(
"left_leg",
CubeListBuilder.create().texOffs(0, 16).mirror().addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, g.extend(-0.1F)),
PartPose.offset(1.9F, 11.0F, 0.0F)
);
return mesh;
}
public void setupAnim(ArmorStandRenderState state) {
super.setupAnim(state);
this.head.xRot = (float) (Math.PI / 180.0) * state.headPose.x();
this.head.yRot = (float) (Math.PI / 180.0) * state.headPose.y();
this.head.zRot = (float) (Math.PI / 180.0) * state.headPose.z();
this.body.xRot = (float) (Math.PI / 180.0) * state.bodyPose.x();
this.body.yRot = (float) (Math.PI / 180.0) * state.bodyPose.y();
this.body.zRot = (float) (Math.PI / 180.0) * state.bodyPose.z();
this.leftArm.xRot = (float) (Math.PI / 180.0) * state.leftArmPose.x();
this.leftArm.yRot = (float) (Math.PI / 180.0) * state.leftArmPose.y();
this.leftArm.zRot = (float) (Math.PI / 180.0) * state.leftArmPose.z();
this.rightArm.xRot = (float) (Math.PI / 180.0) * state.rightArmPose.x();
this.rightArm.yRot = (float) (Math.PI / 180.0) * state.rightArmPose.y();
this.rightArm.zRot = (float) (Math.PI / 180.0) * state.rightArmPose.z();
this.leftLeg.xRot = (float) (Math.PI / 180.0) * state.leftLegPose.x();
this.leftLeg.yRot = (float) (Math.PI / 180.0) * state.leftLegPose.y();
this.leftLeg.zRot = (float) (Math.PI / 180.0) * state.leftLegPose.z();
this.rightLeg.xRot = (float) (Math.PI / 180.0) * state.rightLegPose.x();
this.rightLeg.yRot = (float) (Math.PI / 180.0) * state.rightLegPose.y();
this.rightLeg.zRot = (float) (Math.PI / 180.0) * state.rightLegPose.z();
}
}引用的其他类
-
- 引用位置:
方法调用/继承 - 关联成员:
HumanoidModel.createMesh()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offset()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置: