mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-25 13:57:59 +01:00
Combine upper_torso+body / saddle+jacket
This commit is contained in:
parent
718cae82e8
commit
6820fd8ff3
6 changed files with 24 additions and 45 deletions
|
@ -24,9 +24,6 @@ import net.minecraft.util.math.*;
|
|||
*/
|
||||
public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPonyModel<T> {
|
||||
|
||||
protected final ModelPart upperTorso;
|
||||
protected final ModelPart upperTorsoOverlay;
|
||||
|
||||
protected final ModelPart neck;
|
||||
|
||||
public final RenderList helmetRenderList;
|
||||
|
@ -45,16 +42,14 @@ public abstract class AbstractPonyModel<T extends LivingEntity> 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<T extends LivingEntity> 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<T extends LivingEntity> 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<T extends LivingEntity> 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<T extends LivingEntity> 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));
|
||||
|
|
|
@ -23,7 +23,7 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
|||
steveLeftLeg = tree.getChild("steve_left_leg");
|
||||
|
||||
bodyRenderList.clear();
|
||||
bodyRenderList.add(body, upperTorso, chestPiece);
|
||||
bodyRenderList.add(body, chestPiece);
|
||||
legsRenderList.add(steveLeftLeg, steveRightLeg);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
|||
chestPiece.visible = false;
|
||||
head.visible = false;
|
||||
neck.visible = false;
|
||||
upperTorso.visible = false;
|
||||
steveLeftLeg.visible = false;
|
||||
steveRightLeg.visible = false;
|
||||
|
||||
|
@ -80,7 +79,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
|||
return true;
|
||||
case CHEST:
|
||||
body.visible = variant == ArmourVariant.LEGACY;
|
||||
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
||||
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
||||
return true;
|
||||
default:
|
||||
|
@ -93,7 +91,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
|||
return true;
|
||||
case CHEST:
|
||||
body.visible = variant == ArmourVariant.LEGACY;
|
||||
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
||||
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
||||
return true;
|
||||
default:
|
||||
|
|
|
@ -80,7 +80,6 @@ public class PiglinPonyModel extends ZomponyModel<HostileEntity> {
|
|||
|
||||
neck.pivotY = bodyBob;
|
||||
body.pivotY = bodyBob;
|
||||
upperTorso.pivotY = bodyBob;
|
||||
|
||||
leftLeg.pitch += legBob;
|
||||
rightLeg.pitch -= legBob;
|
||||
|
|
|
@ -14,15 +14,12 @@ import net.minecraft.util.math.MathHelper;
|
|||
|
||||
public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
||||
|
||||
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<T extends LivingEntity> extends UnicornModel<T> {
|
|||
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<T extends LivingEntity> extends UnicornModel<T> {
|
|||
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<T extends LivingEntity> extends UnicornModel<T> {
|
|||
leftPants.visible = false;
|
||||
rightPants.visible = false;
|
||||
|
||||
abdomin.visible = visible;
|
||||
|
||||
leftFin.visible = visible;
|
||||
centerFin.visible = visible;
|
||||
rightFin.visible = visible;
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue