| 1 | package net.minecraft.client.model.animal.armadillo;
|
| 2 |
|
| 3 | import net.fabricmc.api.EnvType;
|
| 4 | import net.fabricmc.api.Environment;
|
| 5 | import net.minecraft.client.animation.definitions.ArmadilloAnimation;
|
| 6 | import net.minecraft.client.model.geom.ModelPart;
|
| 7 | import net.minecraft.client.model.geom.PartPose;
|
| 8 | import net.minecraft.client.model.geom.builders.CubeDeformation;
|
| 9 | import net.minecraft.client.model.geom.builders.CubeListBuilder;
|
| 10 | import net.minecraft.client.model.geom.builders.LayerDefinition;
|
| 11 | import net.minecraft.client.model.geom.builders.MeshDefinition;
|
| 12 | import net.minecraft.client.model.geom.builders.PartDefinition;
|
| 13 |
|
| 14 | @Environment(EnvType.CLIENT)
|
| 15 | public class AdultArmadilloModel extends ArmadilloModel {
|
| 16 | public AdultArmadilloModel(final ModelPart root) {
|
| 17 | super(root, ArmadilloAnimation.ARMADILLO_WALK, ArmadilloAnimation.ARMADILLO_ROLL_OUT, ArmadilloAnimation.ARMADILLO_ROLL_UP, ArmadilloAnimation.ARMADILLO_PEEK);
|
| 18 | }
|
| 19 |
|
| 20 | public static LayerDefinition createBodyLayer() {
|
| 21 | MeshDefinition mesh = new MeshDefinition();
|
| 22 | PartDefinition root = mesh.getRoot();
|
| 23 | PartDefinition body = root.addOrReplaceChild(
|
| 24 | "body",
|
| 25 | CubeListBuilder.create()
|
| 26 | .texOffs(0, 20)
|
| 27 | .addBox(-4.0F, -7.0F, -10.0F, 8.0F, 8.0F, 12.0F, new CubeDeformation(0.3F))
|
| 28 | .texOffs(0, 40)
|
| 29 | .addBox(-4.0F, -7.0F, -10.0F, 8.0F, 8.0F, 12.0F, new CubeDeformation(0.0F)),
|
| 30 | PartPose.offset(0.0F, 21.0F, 4.0F)
|
| 31 | );
|
| 32 | body.addOrReplaceChild(
|
| 33 | "tail",
|
| 34 | CubeListBuilder.create().texOffs(44, 53).addBox(-0.5F, -0.0865F, 0.0933F, 1.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)),
|
| 35 | PartPose.offsetAndRotation(0.0F, -3.0F, 1.0F, 0.5061F, 0.0F, 0.0F)
|
| 36 | );
|
| 37 | PartDefinition head = body.addOrReplaceChild("head", CubeListBuilder.create(), PartPose.offset(0.0F, -2.0F, -11.0F));
|
| 38 | head.addOrReplaceChild(
|
| 39 | "head_cube",
|
| 40 | CubeListBuilder.create().texOffs(43, 15).addBox(-1.5F, -1.0F, -1.0F, 3.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)),
|
| 41 | PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.3927F, 0.0F, 0.0F)
|
| 42 | );
|
| 43 | PartDefinition rightEar = head.addOrReplaceChild("right_ear", CubeListBuilder.create(), PartPose.offset(-1.0F, -1.0F, 0.0F));
|
| 44 | rightEar.addOrReplaceChild(
|
| 45 | "right_ear_cube",
|
| 46 | CubeListBuilder.create().texOffs(43, 10).addBox(-2.0F, -3.0F, 0.0F, 2.0F, 5.0F, 0.0F, new CubeDeformation(0.0F)),
|
| 47 | PartPose.offsetAndRotation(-0.5F, 0.0F, -0.6F, 0.1886F, -0.3864F, -0.0718F)
|
| 48 | );
|
| 49 | PartDefinition leftEar = head.addOrReplaceChild("left_ear", CubeListBuilder.create(), PartPose.offset(1.0F, -2.0F, 0.0F));
|
| 50 | leftEar.addOrReplaceChild(
|
| 51 | "left_ear_cube",
|
| 52 | CubeListBuilder.create().texOffs(47, 10).addBox(0.0F, -3.0F, 0.0F, 2.0F, 5.0F, 0.0F, new CubeDeformation(0.0F)),
|
| 53 | PartPose.offsetAndRotation(0.5F, 1.0F, -0.6F, 0.1886F, 0.3864F, 0.0718F)
|
| 54 | );
|
| 55 | root.addOrReplaceChild(
|
| 56 | "right_hind_leg",
|
| 57 | CubeListBuilder.create().texOffs(51, 31).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)),
|
| 58 | PartPose.offset(-2.0F, 21.0F, 4.0F)
|
| 59 | );
|
| 60 | root.addOrReplaceChild(
|
| 61 | "left_hind_leg",
|
| 62 | CubeListBuilder.create().texOffs(42, 31).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)),
|
| 63 | PartPose.offset(2.0F, 21.0F, 4.0F)
|
| 64 | );
|
| 65 | root.addOrReplaceChild(
|
| 66 | "right_front_leg",
|
| 67 | CubeListBuilder.create().texOffs(51, 43).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)),
|
| 68 | PartPose.offset(-2.0F, 21.0F, -4.0F)
|
| 69 | );
|
| 70 | root.addOrReplaceChild(
|
| 71 | "left_front_leg",
|
| 72 | CubeListBuilder.create().texOffs(42, 43).addBox(-1.0F, 0.0F, -1.0F, 2.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)),
|
| 73 | PartPose.offset(2.0F, 21.0F, -4.0F)
|
| 74 | );
|
| 75 | root.addOrReplaceChild(
|
| 76 | "cube",
|
| 77 | CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -10.0F, -6.0F, 10.0F, 10.0F, 10.0F, new CubeDeformation(0.0F)),
|
| 78 | PartPose.offset(0.0F, 24.0F, 0.0F)
|
| 79 | );
|
| 80 | return LayerDefinition.create(mesh, 64, 64);
|
| 81 | }
|
| 82 | }
|
| 83 |
|