| 1 | package net.minecraft.client.model.monster.nautilus;
|
| 2 |
|
| 3 | import net.fabricmc.api.EnvType;
|
| 4 | import net.fabricmc.api.Environment;
|
| 5 | import net.minecraft.client.model.animal.nautilus.NautilusModel;
|
| 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 | import net.minecraft.client.renderer.entity.state.NautilusRenderState;
|
| 13 |
|
| 14 | @Environment(EnvType.CLIENT)
|
| 15 | public class ZombieNautilusCoralModel extends NautilusModel {
|
| 16 | private final ModelPart corals;
|
| 17 |
|
| 18 | public ZombieNautilusCoralModel(final ModelPart root) {
|
| 19 | super(root);
|
| 20 | ModelPart shell = this.nautilus.getChild("shell");
|
| 21 | this.corals = shell.getChild("corals");
|
| 22 | }
|
| 23 |
|
| 24 | public static LayerDefinition createBodyLayer() {
|
| 25 | MeshDefinition mesh = createBodyMesh();
|
| 26 | PartDefinition corals = mesh.getRoot()
|
| 27 | .getChild("root")
|
| 28 | .getChild("shell")
|
| 29 | .addOrReplaceChild("corals", CubeListBuilder.create(), PartPose.offset(8.0F, 4.5F, -8.0F));
|
| 30 | PartDefinition yellowCoral = corals.addOrReplaceChild("yellow_coral", CubeListBuilder.create(), PartPose.offset(0.0F, -11.0F, 11.0F));
|
| 31 | yellowCoral.addOrReplaceChild(
|
| 32 | "yellow_coral_second",
|
| 33 | CubeListBuilder.create().texOffs(0, 85).addBox(-4.5F, -3.5F, 0.0F, 6.0F, 8.0F, 0.0F),
|
| 34 | PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, 0.0F, -0.7854F, 0.0F)
|
| 35 | );
|
| 36 | yellowCoral.addOrReplaceChild(
|
| 37 | "yellow_coral_first",
|
| 38 | CubeListBuilder.create().texOffs(0, 85).addBox(-4.5F, -3.5F, 0.0F, 6.0F, 8.0F, 0.0F),
|
| 39 | PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.7854F, 0.0F)
|
| 40 | );
|
| 41 | PartDefinition pinkCoral = corals.addOrReplaceChild(
|
| 42 | "pink_coral", CubeListBuilder.create().texOffs(-8, 94).addBox(-4.5F, 4.5F, 0.0F, 6.0F, 0.0F, 8.0F), PartPose.offset(-12.5F, -18.0F, 11.0F)
|
| 43 | );
|
| 44 | pinkCoral.addOrReplaceChild(
|
| 45 | "pink_coral_second",
|
| 46 | CubeListBuilder.create().texOffs(-8, 94).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 0.0F, 8.0F),
|
| 47 | PartPose.offsetAndRotation(-1.5F, 4.5F, 4.0F, 0.0F, 0.0F, 1.5708F)
|
| 48 | );
|
| 49 | PartDefinition blueCoral = corals.addOrReplaceChild("blue_coral", CubeListBuilder.create(), PartPose.offset(-14.0F, 0.0F, 5.5F));
|
| 50 | blueCoral.addOrReplaceChild(
|
| 51 | "blue_second",
|
| 52 | CubeListBuilder.create().texOffs(0, 102).addBox(-3.5F, -5.5F, 0.0F, 5.0F, 10.0F, 0.0F),
|
| 53 | PartPose.offsetAndRotation(0.0F, 0.0F, -2.0F, 0.0F, 0.7854F, 0.0F)
|
| 54 | );
|
| 55 | blueCoral.addOrReplaceChild(
|
| 56 | "blue_first",
|
| 57 | CubeListBuilder.create().texOffs(0, 102).addBox(-3.5F, -5.5F, 0.0F, 5.0F, 10.0F, 0.0F),
|
| 58 | PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -0.7854F, 0.0F)
|
| 59 | );
|
| 60 | PartDefinition redCoral = corals.addOrReplaceChild("red_coral", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F));
|
| 61 | redCoral.addOrReplaceChild(
|
| 62 | "red_coral_second",
|
| 63 | CubeListBuilder.create().texOffs(0, 112).addBox(-2.5F, -5.5F, 0.0F, 4.0F, 10.0F, 0.0F),
|
| 64 | PartPose.offsetAndRotation(-0.5F, -1.0F, 1.5F, 0.0F, -0.829F, 0.0F)
|
| 65 | );
|
| 66 | redCoral.addOrReplaceChild(
|
| 67 | "red_coral_first",
|
| 68 | CubeListBuilder.create().texOffs(0, 112).addBox(-4.5F, -5.5F, 0.0F, 6.0F, 10.0F, 0.0F),
|
| 69 | PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.7854F, 0.0F)
|
| 70 | );
|
| 71 | return LayerDefinition.create(mesh, 128, 128);
|
| 72 | }
|
| 73 |
|
| 74 | @Override
|
| 75 | public void setupAnim(final NautilusRenderState state) {
|
| 76 | super.setupAnim(state);
|
| 77 | this.corals.visible = state.bodyArmorItem.isEmpty();
|
| 78 | }
|
| 79 | }
|
| 80 |
|