| 1 | package net.minecraft.client.model.animal.camel;
|
| 2 |
|
| 3 | import net.fabricmc.api.EnvType;
|
| 4 | import net.fabricmc.api.Environment;
|
| 5 | import net.minecraft.client.animation.definitions.CamelBabyAnimation;
|
| 6 | import net.minecraft.client.model.geom.ModelPart;
|
| 7 | import net.minecraft.client.model.geom.PartPose;
|
| 8 | import net.minecraft.client.model.geom.builders.CubeListBuilder;
|
| 9 | import net.minecraft.client.model.geom.builders.LayerDefinition;
|
| 10 | import net.minecraft.client.model.geom.builders.MeshDefinition;
|
| 11 | import net.minecraft.client.model.geom.builders.PartDefinition;
|
| 12 |
|
| 13 | @Environment(EnvType.CLIENT)
|
| 14 | public class BabyCamelModel extends CamelModel {
|
| 15 | public BabyCamelModel(final ModelPart root) {
|
| 16 | super(
|
| 17 | root,
|
| 18 | CamelBabyAnimation.CAMEL_BABY_WALK,
|
| 19 | CamelBabyAnimation.CAMEL_BABY_SIT,
|
| 20 | CamelBabyAnimation.CAMEL_BABY_SIT_POSE,
|
| 21 | CamelBabyAnimation.CAMEL_BABY_STANDUP,
|
| 22 | CamelBabyAnimation.CAMEL_BABY_IDLE,
|
| 23 | CamelBabyAnimation.CAMEL_BABY_DASH
|
| 24 | );
|
| 25 | }
|
| 26 |
|
| 27 | public static LayerDefinition createBodyLayer() {
|
| 28 | MeshDefinition mesh = new MeshDefinition();
|
| 29 | PartDefinition root = mesh.getRoot();
|
| 30 | PartDefinition body = root.addOrReplaceChild(
|
| 31 | "body", CubeListBuilder.create().texOffs(0, 14).addBox(-4.5F, -4.0F, -8.0F, 9.0F, 8.0F, 16.0F), PartPose.offset(0.0F, 7.0F, 0.0F)
|
| 32 | );
|
| 33 | body.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(50, 38).addBox(-1.5F, -0.5F, 0.0F, 3.0F, 9.0F, 0.0F), PartPose.offset(0.0F, -1.5F, 8.05F));
|
| 34 | PartDefinition head = body.addOrReplaceChild(
|
| 35 | "head",
|
| 36 | CubeListBuilder.create()
|
| 37 | .texOffs(20, 0)
|
| 38 | .addBox(-2.5F, -3.0F, -7.5F, 5.0F, 5.0F, 7.0F)
|
| 39 | .texOffs(0, 0)
|
| 40 | .addBox(-2.5F, -12.0F, -7.5F, 5.0F, 9.0F, 5.0F)
|
| 41 | .texOffs(0, 14)
|
| 42 | .addBox(-2.5F, -12.0F, -10.5F, 5.0F, 4.0F, 3.0F),
|
| 43 | PartPose.offset(0.0F, 1.0F, -7.5F)
|
| 44 | );
|
| 45 | head.addOrReplaceChild(
|
| 46 | "right_ear", CubeListBuilder.create().texOffs(37, 0).addBox(-3.0F, -0.5F, -1.0F, 3.0F, 1.0F, 2.0F), PartPose.offset(-2.5F, -11.0F, -4.0F)
|
| 47 | );
|
| 48 | head.addOrReplaceChild("left_ear", CubeListBuilder.create().texOffs(47, 0).addBox(0.0F, -0.5F, -1.0F, 3.0F, 1.0F, 2.0F), PartPose.offset(2.5F, -11.0F, -4.0F));
|
| 49 | root.addOrReplaceChild(
|
| 50 | "right_front_leg", CubeListBuilder.create().texOffs(36, 14).addBox(-1.5F, -0.5F, -1.5F, 3.0F, 13.0F, 3.0F), PartPose.offset(-3.0F, 11.5F, -5.5F)
|
| 51 | );
|
| 52 | root.addOrReplaceChild(
|
| 53 | "left_front_leg", CubeListBuilder.create().texOffs(48, 14).addBox(-1.5F, -0.5F, -1.5F, 3.0F, 13.0F, 3.0F), PartPose.offset(3.0F, 11.5F, -5.5F)
|
| 54 | );
|
| 55 | root.addOrReplaceChild(
|
| 56 | "left_hind_leg", CubeListBuilder.create().texOffs(12, 38).addBox(-1.5F, -0.5F, -1.5F, 3.0F, 13.0F, 3.0F), PartPose.offset(3.0F, 11.5F, 5.5F)
|
| 57 | );
|
| 58 | root.addOrReplaceChild(
|
| 59 | "right_hind_leg", CubeListBuilder.create().texOffs(0, 38).addBox(-1.5F, -0.5F, -1.5F, 3.0F, 13.0F, 3.0F), PartPose.offset(-3.0F, 11.5F, 5.5F)
|
| 60 | );
|
| 61 | return LayerDefinition.create(mesh, 64, 64);
|
| 62 | }
|
| 63 | }
|
| 64 |
|