Update mson

This commit is contained in:
Sollace 2023-03-20 13:04:07 +00:00
parent 422d6972b6
commit 1c9673a518
25 changed files with 88 additions and 128 deletions

View file

@ -23,4 +23,4 @@ org.gradle.daemon=false
modmenu_version=6.1.0-rc.4
kirin_version=1.14.0-beta.3
hd_skins_version=6.8.0-beta.1
mson_version=1.8.0-beta.4
mson_version=1.8.0-beta.7

View file

@ -19,7 +19,7 @@ public class AlicornModel<T extends LivingEntity> extends UnicornModel<T> implem
@Override
public void init(ModelView context) {
super.init(context);
wings = addPart(context.findByName("wings", PonyWings::new));
wings = addPart(context.findByName("wings"));
bodyRenderList.add(forPart(this::getWings).checked(this::canFly));
}

View file

@ -25,17 +25,13 @@ public class EarthPonyModel<T extends LivingEntity> extends AbstractPonyModel<T>
public void init(ModelView context) {
super.init(context);
tail = addPart(context.findByName("tail", this::createTail, IPart.class));
addPart(context.findByName("snout", PonySnout::new));
addPart(context.findByName("ears", PonyEars::new));
tail = addPart(context.findByName("tail"));
addPart(context.findByName("snout"));
addPart(context.findByName("ears"));
bodyRenderList.add(forPart(tail));
}
protected IPart createTail(ModelPart tree) {
return new PonyTail(tree);
}
@Override
public void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
super.setModelAngles(entity, move, swing, ticks, headYaw, headPitch);

View file

@ -19,7 +19,7 @@ public class PegasusModel<T extends LivingEntity> extends EarthPonyModel<T> impl
@Override
public void init(ModelView context) {
super.init(context);
wings = addPart(context.findByName("wings", PonyWings::new));
wings = addPart(context.findByName("wings"));
bodyRenderList.add(forPart(this::getWings));
}

View file

@ -1,7 +1,6 @@
package com.minelittlepony.client.model.entity.race;
import com.minelittlepony.client.model.armour.PonyArmourModel;
import com.minelittlepony.client.model.part.SeaponyTail;
import com.minelittlepony.mson.api.ModelView;
import com.minelittlepony.api.model.*;
import com.minelittlepony.api.model.armour.ArmourLayer;
@ -33,11 +32,6 @@ public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
this(tree, false);
}
@Override
protected IPart createTail(ModelPart tree) {
return new SeaponyTail(tree);
}
@Override
public void init(ModelView context) {
super.init(context);

View file

@ -30,7 +30,7 @@ public class UnicornModel<T extends LivingEntity> extends EarthPonyModel<T> impl
@Override
public void init(ModelView context) {
super.init(context);
horn = addPart(context.findByName("horn", UnicornHorn::new));
horn = addPart(context.findByName("horn"));
headRenderList.add(RenderList.of().add(head::rotate).add(forPart(horn)).checked(this::hasHorn));
this.mainRenderList.add(withStage(BodyPart.HEAD, RenderList.of().add(head::rotate).add((stack, vertices, overlayUv, lightUv, red, green, blue, alpha) -> {
horn.renderMagic(stack, vertices, getMagicColor());

View file

@ -35,7 +35,7 @@ public class PonyTail implements IPart, MsonModel {
int segments = (int)context.getLocalValue("segments", 4);
for (int i = 0; i < segments; i++) {
Segment segment = context.findByName("segment_" + i, Segment::new);
Segment segment = context.findByName("segment_" + i);
segment.tail = this;
segment.index = i;
this.segments.add(segment);
@ -99,7 +99,7 @@ public class PonyTail implements IPart, MsonModel {
stack.pop();
}
public static class Segment implements MsonModel {
public static class Segment {
public PonyTail tail;
public int index;

View file

@ -20,9 +20,6 @@ public class PonyWings<T extends Model & IPegasus> implements IPart, MsonModel {
protected Wing legacyWing;
private float wingScale;
private float walkingRotationSpeed;
public PonyWings(ModelPart tree) {
}
@ -30,11 +27,9 @@ public class PonyWings<T extends Model & IPegasus> implements IPart, MsonModel {
@Override
public void init(ModelView context) {
pegasus = context.getModel();
leftWing = context.findByName("left_wing", Wing::new);
rightWing = context.findByName("right_wing", Wing::new);
legacyWing = context.findByName("legacy_right_wing", Wing::new);
wingScale = context.getLocalValue("wing_scale", 1); // pegasi 1 / bats 1.3F
walkingRotationSpeed = context.getLocalValue("walking_rotation_speed", 0.15F); // pegasi 0.15 / bats 0.05F
leftWing = context.findByName("left_wing");
rightWing = context.findByName("right_wing");
legacyWing = context.findByName("legacy_right_wing");
}
public Wing getLeft() {
@ -90,13 +85,16 @@ public class PonyWings<T extends Model & IPegasus> implements IPart, MsonModel {
getRight().render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
}
public class Wing implements MsonModel {
public static class Wing implements MsonModel {
protected IPegasus pegasus;
protected final ModelPart extended;
protected final ModelPart folded;
private float wingScale;
private float walkingRotationSpeed;
public Wing(ModelPart tree) {
extended = tree.getChild("extended");
folded = tree.getChild("folded");
@ -105,6 +103,8 @@ public class PonyWings<T extends Model & IPegasus> implements IPart, MsonModel {
@Override
public void init(ModelView context) {
pegasus = context.getModel();
wingScale = context.getLocalValue("wing_scale", 1); // pegasi 1 / bats 1.3F
walkingRotationSpeed = context.getLocalValue("walking_rotation_speed", 0.15F); // pegasi 0.15 / bats 0.05F
}
public void rotateWalking(float swing) {

View file

@ -2,13 +2,14 @@ package com.minelittlepony.client.model.part;
import com.minelittlepony.api.model.IPart;
import com.minelittlepony.api.model.ModelAttributes;
import com.minelittlepony.mson.api.MsonModel;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.MathHelper;
public class SeaponyTail implements IPart {
public class SeaponyTail implements IPart, MsonModel {
private static final float TAIL_ROTX = PI / 2;

View file

@ -5,8 +5,7 @@
},
"data": {
"left_wing": {
"type": "mson:slot",
"name": "left_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
@ -58,8 +57,7 @@
}
},
"right_wing": {
"type": "mson:slot",
"name": "right_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},

View file

@ -1,8 +1,7 @@
{
"data": {
"left_wing": {
"type": "mson:slot",
"name": "left_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": "#extended",
"extended": {
@ -24,8 +23,7 @@
}
},
"right_wing": {
"type": "mson:slot",
"name": "right_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": "#extended",
"extended": {

View file

@ -1,8 +1,7 @@
{
"data": {
"left_wing": {
"type": "mson:slot",
"name": "left_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 32, "w": 64, "h": 64},
@ -30,8 +29,7 @@
}
},
"right_wing": {
"type": "mson:slot",
"name": "right_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
@ -59,8 +57,7 @@
}
},
"legacy_right_wing": {
"type": "mson:slot",
"name": "legacy_right_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 32, "w": 64, "h": 64},

View file

@ -8,27 +8,23 @@
"pivot": [0, 0, 14],
"children": {
"segment_0": {
"type": "mson:slot",
"name": "segment_0",
"locals": { "segment_index": 0 },
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"data": "minelittlepony:components/tail_segment"
},
"segment_1": {
"type": "mson:slot",
"name": "segment_1",
"locals": { "segment_index": 1 },
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"data": "minelittlepony:components/tail_segment"
},
"segment_2": {
"type": "mson:slot",
"name": "segment_2",
"locals": { "segment_index": 2 },
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"data": "minelittlepony:components/tail_segment"
},
"segment_3": {
"type": "mson:slot",
"name": "segment_3",
"locals": { "segment_index": 3 },
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"data": "minelittlepony:components/tail_segment"
}
}

View file

@ -11,9 +11,9 @@
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
],
"children": {
"snout": { "data": "minelittlepony:components/snout" },
"ears": { "data": "minelittlepony:components/ears" },
"horn": { "data": "minelittlepony:components/horn" },
"snout": { "data": "minelittlepony:components/snout", "implementation": "com.minelittlepony.client.model.part.PonySnout" },
"ears": { "data": "minelittlepony:components/ears", "implementation": "com.minelittlepony.client.model.part.PonyEars" },
"horn": { "data": "minelittlepony:components/horn", "implementation": "com.minelittlepony.client.model.part.UnicornHorn" },
"left_horn": {
"texture": {"u": 0, "v": 52},
"name": "left_horn",

View file

@ -26,22 +26,16 @@
]
},
"snout": {
"type": "mson:slot",
"name": "snout",
"texture": {"w": 128, "h": 64},
"implementation": "com.minelittlepony.client.model.part.PonySnout",
"data": "minelittlepony:components/pig_snout"
},
"ears": {
"type": "mson:slot",
"name": "ears",
"texture": {"w": 128, "h": 64},
"implementation": "com.minelittlepony.client.model.part.PonyEars",
"data": "minelittlepony:components/ears"
},
"horn": {
"type": "mson:slot",
"name": "horn",
"texture": {"w": 128, "h": 64},
"implementation": "com.minelittlepony.client.model.part.UnicornHorn",
"data": "minelittlepony:components/horn"
@ -49,15 +43,11 @@
}
},
"wings": {
"type": "mson:slot",
"name": "wings",
"implementation": "com.minelittlepony.client.model.part.PegasusWings",
"implementation": "com.minelittlepony.client.model.part.PonyWings",
"data": {
"left_wing": {
"type": "mson:slot",
"name": "left_wing",
"texture": {"w": 128, "h": 64},
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 32},
@ -85,10 +75,8 @@
}
},
"right_wing": {
"type": "mson:slot",
"name": "right_wing",
"texture": {"w": 128, "h": 64},
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 16},
@ -116,10 +104,7 @@
}
},
"legacy_right_wing": {
"type": "mson:slot",
"name": "legacy_right_wing",
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": {
"texture": {"u": 56, "v": 32},
@ -149,8 +134,6 @@
}
},
"tail": {
"type": "mson:slot",
"name": "tail",
"implementation": "com.minelittlepony.client.model.part.PonyTail",
"texture": {"w": 128, "h": 64},
"locals": {
@ -161,32 +144,24 @@
"pivot": [0, 0, 14],
"children": {
"segment_0": {
"type": "mson:slot",
"name": "segment_0",
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"locals": { "segment_index": 0 },
"texture": {"w": 128, "h": 64},
"data": "minelittlepony:components/tail_segment"
},
"segment_1": {
"type": "mson:slot",
"name": "segment_1",
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"locals": { "segment_index": 1 },
"texture": {"w": 128, "h": 64},
"data": "minelittlepony:components/tail_segment"
},
"segment_2": {
"type": "mson:slot",
"name": "segment_2",
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"locals": { "segment_index": 2 },
"texture": {"w": 128, "h": 64},
"data": "minelittlepony:components/tail_segment"
},
"segment_3": {
"type": "mson:slot",
"name": "segment_3",
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
"locals": { "segment_index": 3 },
"texture": {"w": 128, "h": 64},

View file

@ -1,6 +1,9 @@
{
"parent": "minelittlepony:races/steve/unicorn",
"data": {
"wings": { "data": "minelittlepony:components/pegasus_wings" }
"wings": {
"data": "minelittlepony:components/pegasus_wings",
"implementation": "com.minelittlepony.client.model.part.PonyWings"
}
}
}

View file

@ -6,10 +6,19 @@
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
],
"children": {
"snout": { "data": "minelittlepony:components/snout" },
"ears": { "data": "minelittlepony:components/bat_ears" }
"snout": {
"data": "minelittlepony:components/snout",
"implementation": "com.minelittlepony.client.model.part.PonySnout"
},
"ears": {
"data": "minelittlepony:components/bat_ears",
"implementation": "com.minelittlepony.client.model.part.PonyEars"
}
}
},
"wings": { "data": "minelittlepony:components/bat_wings" }
"wings": {
"data": "minelittlepony:components/bat_wings",
"implementation": "com.minelittlepony.client.model.part.PonyWings"
}
}
}

View file

@ -1,6 +1,9 @@
{
"parent": "minelittlepony:races/steve/alicorn",
"data": {
"wings": { "data": "minelittlepony:components/bug_wings" }
"wings": {
"data": "minelittlepony:components/bug_wings",
"implementation": "com.minelittlepony.client.model.part.PonyWings"
}
}
}

View file

@ -7,21 +7,24 @@
],
"children": {
"snout": {
"data": "minelittlepony:components/snout"
"data": "minelittlepony:components/snout",
"implementation": "com.minelittlepony.client.model.part.PonySnout"
},
"ears": {
"locals": {
"ear_pronouncement": 0.9,
"ear_spread": 3
},
"data": "minelittlepony:components/ears"
"data": "minelittlepony:components/ears",
"implementation": "com.minelittlepony.client.model.part.PonyEars"
},
"horn": {
"locals": {
"incline": 19,
"scale": 0.5
},
"data": "minelittlepony:components/horn"
"data": "minelittlepony:components/horn",
"implementation": "com.minelittlepony.client.model.part.UnicornHorn"
}
}
},

View file

@ -1,6 +1,9 @@
{
"parent": "minelittlepony:steve_pony",
"data": {
"wings": { "data": "minelittlepony:components/pegasus_wings" }
"wings": {
"data": "minelittlepony:components/pegasus_wings",
"implementation": "com.minelittlepony.client.model.part.PonyWings"
}
}
}

View file

@ -6,9 +6,13 @@
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
],
"children": {
"snout": { "data": "minelittlepony:components/snout" },
"snout": {
"data": "minelittlepony:components/snout",
"implementation": "com.minelittlepony.client.model.part.PonySnout"
},
"ears": {
"texture": {"w": 64, "h": 64 },
"implementation": "com.minelittlepony.client.model.part.PonyEars",
"data": {
"right": {
"type": "mson:planar",
@ -40,7 +44,10 @@
}
}
},
"horn": { "data": "minelittlepony:components/horn" },
"horn": {
"data": "minelittlepony:components/horn",
"implementation": "com.minelittlepony.client.model.part.UnicornHorn"
},
"right_antler": {
"pivot": [-2, -6, -2],
"rotate": [0, 0, 120],
@ -82,12 +89,10 @@
}
},
"wings": {
"type": "mson:slot",
"name": "wings",
"implementation": "com.minelittlepony.client.model.part.PonyWings",
"data": {
"left_wing": {
"type": "mson:slot",
"name": "left_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": "#extended",
"extended": {
@ -109,8 +114,7 @@
}
},
"right_wing": {
"type": "mson:slot",
"name": "right_wing",
"implementation": "com.minelittlepony.client.model.part.PonyWings$Wing",
"data": {
"folded": "#extended",
"extended": {

View file

@ -6,9 +6,9 @@
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
],
"children": {
"snout": { "data": "minelittlepony:components/snout" },
"ears": { "data": "minelittlepony:components/ears" },
"horn": { "data": "minelittlepony:components/horn" }
"snout": { "data": "minelittlepony:components/snout", "implementation": "com.minelittlepony.client.model.part.PonySnout" },
"ears": { "data": "minelittlepony:components/ears", "implementation": "com.minelittlepony.client.model.part.PonyEars" },
"horn": { "data": "minelittlepony:components/horn", "implementation": "com.minelittlepony.client.model.part.UnicornHorn" }
}
},
"right_cast": {

View file

@ -11,8 +11,8 @@
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
],
"children": {
"snout": { "data": "minelittlepony:components/snout" },
"ears": { "data": "minelittlepony:components/ears" },
"snout": { "data": "minelittlepony:components/snout", "implementation": "com.minelittlepony.client.model.part.PonySnout" },
"ears": { "data": "minelittlepony:components/ears", "implementation": "com.minelittlepony.client.model.part.PonyEars" },
"bristles": {
"texture": {"u": 56, "v": 32},
"rotate": [17, 0, 0],

View file

@ -16,22 +16,6 @@
"head_pivot_y": 0,
"neck_dilate_y": -0.1
},
"skeleton": {
"upper_torso": {
"body": {
"neck": {
"head": {
"horn": {}
}
},
"left_arm": {},
"right_arm": {}
},
"left_leg": {},
"right_leg": {},
"wings": {}
}
},
"data": {
"head": {
"pivot": [ 0, "#head_pivot_y", 0 ],
@ -40,14 +24,10 @@
],
"children": {
"snout": {
"type": "mson:slot",
"name": "snout",
"implementation": "com.minelittlepony.client.model.part.PonySnout",
"data": "minelittlepony:components/snout"
},
"ears": {
"type": "mson:slot",
"name": "ears",
"implementation": "com.minelittlepony.client.model.part.PonyEars",
"data": "minelittlepony:components/ears"
}

View file

@ -35,7 +35,7 @@
"bat_wings": {
"type": "mson:slot",
"name": "bat_wings",
"implementation": "com.minelittlepony.client.model.part.BatWings",
"implementation": "com.minelittlepony.client.model.part.PonyWings",
"data": "minelittlepony:components/bat_wings"
},
"apron": {