From 6820fd8ff3163e72213f0948dbd69770a2612cb9 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 20 Mar 2023 19:51:21 +0000 Subject: [PATCH] Combine upper_torso+body / saddle+jacket --- .../client/model/AbstractPonyModel.java | 19 ++--------------- .../client/model/armour/PonyArmourModel.java | 5 +---- .../client/model/entity/PiglinPonyModel.java | 1 - .../model/entity/race/SeaponyModel.java | 8 +------ .../models/entity/races/steve/sea_pony.json | 15 +++++++++---- .../models/entity/steve_pony.json | 21 ++++++++----------- 6 files changed, 24 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java b/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java index 6a93579d..f6e53c18 100644 --- a/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java +++ b/src/main/java/com/minelittlepony/client/model/AbstractPonyModel.java @@ -24,9 +24,6 @@ import net.minecraft.util.math.*; */ public abstract class AbstractPonyModel extends ClientPonyModel { - protected final ModelPart upperTorso; - protected final ModelPart upperTorsoOverlay; - protected final ModelPart neck; public final RenderList helmetRenderList; @@ -45,16 +42,14 @@ public abstract class AbstractPonyModel extends ClientPo public AbstractPonyModel(ModelPart tree) { super(tree); - upperTorso = tree.getChild("upper_torso"); - upperTorsoOverlay = tree.getChild("saddle"); neck = tree.getChild("neck"); mainRenderList = RenderList.of() - .add(withStage(BodyPart.BODY, bodyRenderList = RenderList.of(body, upperTorso).add(body::rotate))) + .add(withStage(BodyPart.BODY, bodyRenderList = RenderList.of(body).add(body::rotate))) .add(withStage(BodyPart.NECK, neckRenderList = RenderList.of(neck))) .add(withStage(BodyPart.HEAD, headRenderList = RenderList.of(head))) .add(withStage(BodyPart.LEGS, legsRenderList = RenderList.of().add(leftArm, rightArm, leftLeg, rightLeg))) .add(withStage(BodyPart.LEGS, sleevesRenderList = RenderList.of().add(leftSleeve, rightSleeve, leftPants, rightPants))) - .add(withStage(BodyPart.BODY, vestRenderList = RenderList.of(jacket, upperTorsoOverlay))) + .add(withStage(BodyPart.BODY, vestRenderList = RenderList.of(jacket))) .add(withStage(BodyPart.HEAD, helmetRenderList = RenderList.of(hat))); } @@ -122,7 +117,6 @@ public abstract class AbstractPonyModel extends ClientPo rightPants.copyTransform(rightLeg); jacket.copyTransform(body); hat.copyTransform(head); - upperTorsoOverlay.copyTransform(upperTorso); } protected void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) { @@ -264,7 +258,6 @@ public abstract class AbstractPonyModel extends ClientPo * @param ticks Total whole and partial ticks since the entity's existance. Used in animations together with {@code swing} and {@code move}. */ protected void shakeBody(float move, float swing, float bodySwing, float ticks) { - upperTorso.yaw = bodySwing; body.yaw = bodySwing; neck.yaw = bodySwing; } @@ -582,10 +575,6 @@ public abstract class AbstractPonyModel extends ClientPo body.pitch = rotateAngleX; body.pivotY = rotationPointY; body.pivotZ = rotationPointZ; - - upperTorso.pitch = rotateAngleX; - upperTorso.pivotY = rotationPointY; - upperTorso.pivotZ = rotationPointZ; } @Override @@ -602,10 +591,6 @@ public abstract class AbstractPonyModel extends ClientPo @Override public void setVisible(boolean visible) { super.setVisible(visible); - - upperTorso.visible = visible; - upperTorsoOverlay.visible = visible; - neck.visible = visible; parts.forEach(part -> part.setVisible(visible)); diff --git a/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java b/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java index 5b8aee84..cd1f07c5 100644 --- a/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java +++ b/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java @@ -23,7 +23,7 @@ public class PonyArmourModel extends AbstractPonyModel extends AbstractPonyModel extends AbstractPonyModel extends AbstractPonyModel { neck.pivotY = bodyBob; body.pivotY = bodyBob; - upperTorso.pivotY = bodyBob; leftLeg.pitch += legBob; rightLeg.pitch -= legBob; diff --git a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java index 95eba656..fba425db 100644 --- a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java +++ b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java @@ -14,15 +14,12 @@ import net.minecraft.util.math.MathHelper; public class SeaponyModel extends UnicornModel { - private final ModelPart abdomin; - private final ModelPart leftFin; private final ModelPart centerFin; private final ModelPart rightFin; public SeaponyModel(ModelPart tree, boolean smallArms) { super(tree, smallArms); - abdomin = tree.getChild("abdomin"); leftFin = tree.getChild("left_fin"); rightFin = tree.getChild("right_fin"); centerFin = tree.getChild("center_fin"); @@ -37,7 +34,7 @@ public class SeaponyModel extends UnicornModel { super.init(context); setVisible(true); bodyRenderList.clear(); - bodyRenderList.add(body, abdomin).add(body::rotate).add(forPart(tail)).add(leftFin, centerFin, rightFin); + bodyRenderList.add(body).add(body::rotate).add(forPart(tail)).add(leftFin, centerFin, rightFin); } @Override @@ -114,7 +111,6 @@ public class SeaponyModel extends UnicornModel { public void setVisible(boolean visible) { super.setVisible(visible); - upperTorsoOverlay.visible = false; leftSleeve.visible = false; rightSleeve.visible = false; jacket.visible = false; @@ -125,8 +121,6 @@ public class SeaponyModel extends UnicornModel { leftPants.visible = false; rightPants.visible = false; - abdomin.visible = visible; - leftFin.visible = visible; centerFin.visible = visible; rightFin.visible = visible; diff --git a/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json b/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json index a231dfc5..ebc59191 100644 --- a/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json +++ b/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json @@ -20,11 +20,18 @@ "pivot": [0, 6, 9], "east": [0, -6, 0, 6, 12] }, - "abdomin": { - "texture": {"u": 0, "v": 48}, - "pivot": [0, 6, 1], + "body": { "cubes": [ - { "from": [-3, -1, 0], "size": [6, 7, 9] } + { + "texture": { "u": 16, "v": 16 }, + "from": [-4, 4, -2], + "size": [ 8, 8, 4] + }, + { + "texture": {"u": 0, "v": 48}, + "from": [-3, 5, 1], + "size": [6, 7, 9] + } ] }, "tail": { diff --git a/src/main/resources/assets/minelittlepony/models/entity/steve_pony.json b/src/main/resources/assets/minelittlepony/models/entity/steve_pony.json index e208d0f6..f582dfa9 100644 --- a/src/main/resources/assets/minelittlepony/models/entity/steve_pony.json +++ b/src/main/resources/assets/minelittlepony/models/entity/steve_pony.json @@ -41,14 +41,13 @@ ] }, "body": { - "texture": { "u": 16, "v": 16 }, - "cubes": [ - { "from": [-4, 4, -2], "size": [ 8, 8, 4] } - ] - }, - "upper_torso": { "texture": { "u": 24, "v": 0 }, "cubes": [ + { + "texture": { "u": 16, "v": 16 }, + "from": [-4, 4, -2], + "size": [ 8, 8, 4] + }, { "type": "mson:plane", "__comment": "body sides", "texture": { "u": 24, "v": 0 }, @@ -171,13 +170,11 @@ "west": [-2, 1.199998, -2.8, 4, 4] }, "jacket": { - "cubes": [ - { "from": [-4, 4, -2], "size": [ 8, 8, 4 ], "texture": { "u": 16, "v": 32 }, "dilate": 0.25 } - ] - }, - "saddle": { "texture": { "u": 24, "v": 0 }, - "dilate": 0.26, + "dilate": 0.25, + "cubes": [ + { "from": [-4, 4, -2], "size": [ 8, 8, 4 ], "texture": { "u": 16, "v": 32 }, "dilate": 0.25 } + ], "children": { "left_side": { "type": "mson:planar",