mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-18 02:24:22 +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> {
|
public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPonyModel<T> {
|
||||||
|
|
||||||
protected final ModelPart upperTorso;
|
|
||||||
protected final ModelPart upperTorsoOverlay;
|
|
||||||
|
|
||||||
protected final ModelPart neck;
|
protected final ModelPart neck;
|
||||||
|
|
||||||
public final RenderList helmetRenderList;
|
public final RenderList helmetRenderList;
|
||||||
|
@ -45,16 +42,14 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
public AbstractPonyModel(ModelPart tree) {
|
public AbstractPonyModel(ModelPart tree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
|
|
||||||
upperTorso = tree.getChild("upper_torso");
|
|
||||||
upperTorsoOverlay = tree.getChild("saddle");
|
|
||||||
neck = tree.getChild("neck");
|
neck = tree.getChild("neck");
|
||||||
mainRenderList = RenderList.of()
|
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.NECK, neckRenderList = RenderList.of(neck)))
|
||||||
.add(withStage(BodyPart.HEAD, headRenderList = RenderList.of(head)))
|
.add(withStage(BodyPart.HEAD, headRenderList = RenderList.of(head)))
|
||||||
.add(withStage(BodyPart.LEGS, legsRenderList = RenderList.of().add(leftArm, rightArm, leftLeg, rightLeg)))
|
.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.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)));
|
.add(withStage(BodyPart.HEAD, helmetRenderList = RenderList.of(hat)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +117,6 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
rightPants.copyTransform(rightLeg);
|
rightPants.copyTransform(rightLeg);
|
||||||
jacket.copyTransform(body);
|
jacket.copyTransform(body);
|
||||||
hat.copyTransform(head);
|
hat.copyTransform(head);
|
||||||
upperTorsoOverlay.copyTransform(upperTorso);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
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}.
|
* @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) {
|
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
||||||
upperTorso.yaw = bodySwing;
|
|
||||||
body.yaw = bodySwing;
|
body.yaw = bodySwing;
|
||||||
neck.yaw = bodySwing;
|
neck.yaw = bodySwing;
|
||||||
}
|
}
|
||||||
|
@ -582,10 +575,6 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
body.pitch = rotateAngleX;
|
body.pitch = rotateAngleX;
|
||||||
body.pivotY = rotationPointY;
|
body.pivotY = rotationPointY;
|
||||||
body.pivotZ = rotationPointZ;
|
body.pivotZ = rotationPointZ;
|
||||||
|
|
||||||
upperTorso.pitch = rotateAngleX;
|
|
||||||
upperTorso.pivotY = rotationPointY;
|
|
||||||
upperTorso.pivotZ = rotationPointZ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -602,10 +591,6 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
@Override
|
@Override
|
||||||
public void setVisible(boolean visible) {
|
public void setVisible(boolean visible) {
|
||||||
super.setVisible(visible);
|
super.setVisible(visible);
|
||||||
|
|
||||||
upperTorso.visible = visible;
|
|
||||||
upperTorsoOverlay.visible = visible;
|
|
||||||
|
|
||||||
neck.visible = visible;
|
neck.visible = visible;
|
||||||
|
|
||||||
parts.forEach(part -> part.setVisible(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");
|
steveLeftLeg = tree.getChild("steve_left_leg");
|
||||||
|
|
||||||
bodyRenderList.clear();
|
bodyRenderList.clear();
|
||||||
bodyRenderList.add(body, upperTorso, chestPiece);
|
bodyRenderList.add(body, chestPiece);
|
||||||
legsRenderList.add(steveLeftLeg, steveRightLeg);
|
legsRenderList.add(steveLeftLeg, steveRightLeg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
||||||
chestPiece.visible = false;
|
chestPiece.visible = false;
|
||||||
head.visible = false;
|
head.visible = false;
|
||||||
neck.visible = false;
|
neck.visible = false;
|
||||||
upperTorso.visible = false;
|
|
||||||
steveLeftLeg.visible = false;
|
steveLeftLeg.visible = false;
|
||||||
steveRightLeg.visible = false;
|
steveRightLeg.visible = false;
|
||||||
|
|
||||||
|
@ -80,7 +79,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
||||||
return true;
|
return true;
|
||||||
case CHEST:
|
case CHEST:
|
||||||
body.visible = variant == ArmourVariant.LEGACY;
|
body.visible = variant == ArmourVariant.LEGACY;
|
||||||
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
|
||||||
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
@ -93,7 +91,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
||||||
return true;
|
return true;
|
||||||
case CHEST:
|
case CHEST:
|
||||||
body.visible = variant == ArmourVariant.LEGACY;
|
body.visible = variant == ArmourVariant.LEGACY;
|
||||||
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
|
||||||
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -80,7 +80,6 @@ public class PiglinPonyModel extends ZomponyModel<HostileEntity> {
|
||||||
|
|
||||||
neck.pivotY = bodyBob;
|
neck.pivotY = bodyBob;
|
||||||
body.pivotY = bodyBob;
|
body.pivotY = bodyBob;
|
||||||
upperTorso.pivotY = bodyBob;
|
|
||||||
|
|
||||||
leftLeg.pitch += legBob;
|
leftLeg.pitch += legBob;
|
||||||
rightLeg.pitch -= legBob;
|
rightLeg.pitch -= legBob;
|
||||||
|
|
|
@ -14,15 +14,12 @@ import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
||||||
|
|
||||||
private final ModelPart abdomin;
|
|
||||||
|
|
||||||
private final ModelPart leftFin;
|
private final ModelPart leftFin;
|
||||||
private final ModelPart centerFin;
|
private final ModelPart centerFin;
|
||||||
private final ModelPart rightFin;
|
private final ModelPart rightFin;
|
||||||
|
|
||||||
public SeaponyModel(ModelPart tree, boolean smallArms) {
|
public SeaponyModel(ModelPart tree, boolean smallArms) {
|
||||||
super(tree, smallArms);
|
super(tree, smallArms);
|
||||||
abdomin = tree.getChild("abdomin");
|
|
||||||
leftFin = tree.getChild("left_fin");
|
leftFin = tree.getChild("left_fin");
|
||||||
rightFin = tree.getChild("right_fin");
|
rightFin = tree.getChild("right_fin");
|
||||||
centerFin = tree.getChild("center_fin");
|
centerFin = tree.getChild("center_fin");
|
||||||
|
@ -37,7 +34,7 @@ public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
||||||
super.init(context);
|
super.init(context);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
bodyRenderList.clear();
|
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
|
@Override
|
||||||
|
@ -114,7 +111,6 @@ public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
||||||
public void setVisible(boolean visible) {
|
public void setVisible(boolean visible) {
|
||||||
super.setVisible(visible);
|
super.setVisible(visible);
|
||||||
|
|
||||||
upperTorsoOverlay.visible = false;
|
|
||||||
leftSleeve.visible = false;
|
leftSleeve.visible = false;
|
||||||
rightSleeve.visible = false;
|
rightSleeve.visible = false;
|
||||||
jacket.visible = false;
|
jacket.visible = false;
|
||||||
|
@ -125,8 +121,6 @@ public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
||||||
leftPants.visible = false;
|
leftPants.visible = false;
|
||||||
rightPants.visible = false;
|
rightPants.visible = false;
|
||||||
|
|
||||||
abdomin.visible = visible;
|
|
||||||
|
|
||||||
leftFin.visible = visible;
|
leftFin.visible = visible;
|
||||||
centerFin.visible = visible;
|
centerFin.visible = visible;
|
||||||
rightFin.visible = visible;
|
rightFin.visible = visible;
|
||||||
|
|
|
@ -20,11 +20,18 @@
|
||||||
"pivot": [0, 6, 9],
|
"pivot": [0, 6, 9],
|
||||||
"east": [0, -6, 0, 6, 12]
|
"east": [0, -6, 0, 6, 12]
|
||||||
},
|
},
|
||||||
"abdomin": {
|
"body": {
|
||||||
"texture": {"u": 0, "v": 48},
|
|
||||||
"pivot": [0, 6, 1],
|
|
||||||
"cubes": [
|
"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": {
|
"tail": {
|
||||||
|
|
|
@ -41,14 +41,13 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"body": {
|
"body": {
|
||||||
"texture": { "u": 16, "v": 16 },
|
|
||||||
"cubes": [
|
|
||||||
{ "from": [-4, 4, -2], "size": [ 8, 8, 4] }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"upper_torso": {
|
|
||||||
"texture": { "u": 24, "v": 0 },
|
"texture": { "u": 24, "v": 0 },
|
||||||
"cubes": [
|
"cubes": [
|
||||||
|
{
|
||||||
|
"texture": { "u": 16, "v": 16 },
|
||||||
|
"from": [-4, 4, -2],
|
||||||
|
"size": [ 8, 8, 4]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "mson:plane", "__comment": "body sides",
|
"type": "mson:plane", "__comment": "body sides",
|
||||||
"texture": { "u": 24, "v": 0 },
|
"texture": { "u": 24, "v": 0 },
|
||||||
|
@ -171,13 +170,11 @@
|
||||||
"west": [-2, 1.199998, -2.8, 4, 4]
|
"west": [-2, 1.199998, -2.8, 4, 4]
|
||||||
},
|
},
|
||||||
"jacket": {
|
"jacket": {
|
||||||
"cubes": [
|
|
||||||
{ "from": [-4, 4, -2], "size": [ 8, 8, 4 ], "texture": { "u": 16, "v": 32 }, "dilate": 0.25 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"saddle": {
|
|
||||||
"texture": { "u": 24, "v": 0 },
|
"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": {
|
"children": {
|
||||||
"left_side": {
|
"left_side": {
|
||||||
"type": "mson:planar",
|
"type": "mson:planar",
|
||||||
|
|
Loading…
Reference in a new issue