Added kirin models

This commit is contained in:
Sollace 2022-06-22 23:29:55 +02:00
parent 110d8fac90
commit 869c6fac84
6 changed files with 250 additions and 11 deletions

View file

@ -0,0 +1,93 @@
package com.minelittlepony.client.model.part;
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;
import com.minelittlepony.api.model.IPart;
import com.minelittlepony.client.model.IPonyModel;
import com.minelittlepony.common.util.animation.Interpolator;
import com.minelittlepony.mson.api.ModelContext;
import com.minelittlepony.mson.api.MsonModel;
import java.util.UUID;
public class LionTail implements IPart, MsonModel {
private ModelPart tail;
private IPonyModel<?> model;
public LionTail(ModelPart tree) {
tail = tree.getChild("tail");
}
@Override
public void init(ModelContext context) {
model = context.getModel();
}
@Override
public void setRotationAndAngles(boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
float baseSail = 1F;
float speed = swing > 0.01F ? 6 : 90;
Interpolator interpolator = Interpolator.linear(interpolatorId);
float straightness = 1.6F * (1 + (float)Math.sin(ticks / speed) / 8F);
float bend = (float)Math.sin(Math.PI/2F + 2 * ticks / speed) / 16F;
if (model.getAttributes().isCrouching) {
baseSail += 1;
straightness += 0.5F;
}
straightness = interpolator.interpolate("kirin_tail_straightness", straightness, 10);
bend = interpolator.interpolate("kirin_tail_bendiness", bend, 10);
tail.pitch = baseSail;
tail.pitch += swing / 2;
tail.yaw = bend;
tail.roll = bodySwing * 2;
float sinTickFactor = MathHelper.sin(ticks * 0.067f) * 0.05f;
tail.pitch += sinTickFactor;
tail.yaw += sinTickFactor;
var tail2 = tail.getChild("tail2");
tail2.pitch = -(baseSail + sinTickFactor) / straightness;
tail2.yaw = bend;
tail2.roll = bodySwing;
var tail3 = tail2.getChild("tail3");
tail3.pitch = tail2.pitch / straightness;
tail3.yaw = tail2.yaw;
tail3.roll = -bodySwing;
var tail4 = tail3.getChild("tail4");
tail4.pitch = tail3.pitch / straightness;
tail4.yaw = -tail3.yaw * 7F;
tail4.roll = -bodySwing;
var tail5 = tail4.getChild("tail5");
tail5.pitch = -tail4.pitch * straightness;
tail5.yaw = -tail4.yaw * 2F;
tail5.roll = -bodySwing * 2;
var tail6 = tail5.getChild("tail6");
tail6.pitch = tail5.pitch * straightness;
tail6.yaw = tail5.yaw;
tail6.roll = -bodySwing * 2F;
}
@Override
public void setVisible(boolean visible) {
tail.visible = visible;
}
@Override
public void renderPart(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, UUID interpolatorId) {
tail.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
}
}

View file

@ -3,22 +3,27 @@
"locals": {
"x": 0,
"y": 0,
"z": 0
"z": 0,
"ear_pronouncement": 0,
"ear_spread": 0,
"ear_spread_neg": [0, "-", "#ear_spread"]
},
"data": {
"right": {
"texture": {"u": 12, "v": 16},
"pivot": ["#x", "#y", "#z"],
"rotate": [0, 0, "#ear_spread"],
"cubes": [
{ "from": [-4, -8, -1], "size": [2, 2, 2] }
{ "from": [-4, -8, -1], "size": [2, 2, 2], "dilate": [0, "#ear_pronouncement", 0] }
]
},
"left": {
"texture": {"u": 12, "v": 16},
"pivot": ["#x", "#y", "#z"],
"mirror": [true, false, false],
"rotate": [0, 0, "#ear_spread_neg"],
"cubes": [
{ "from": [2, -8, -1], "size": [2, 2, 2] }
{ "from": [2, -8, -1], "size": [2, 2, 2], "dilate": [0, "#ear_pronouncement", 0] }
]
}
}

View file

@ -3,32 +3,36 @@
"locals": {
"x": 0,
"y": 0,
"z": 0
"z": 0,
"scale": 0,
"incline": 29,
"corona_inner_dilate": ["#scale", "+", 0.5],
"corona_outer_dilate": ["#scale", "+", 0.8]
},
"data": {
"bone": {
"rotate": [29, 0, 0],
"rotate": ["#incline", 0, 0],
"pivot": ["#x", "#y", "#z"],
"cubes": [
{ "from": [-0.5, -11, -3.5], "size": [1, 4, 1] }
{ "from": [-0.5, -11, -3.5], "size": [1, 4, 1], "dilate": "#scale" }
]
},
"corona": {
"rotate": [29, 0, 0],
"rotate": ["#incline", 0, 0],
"pivot": ["#x", "#y", "#z"],
"cubes": [
{
"type": "mson:cone",
"size": [1, 4, 1],
"from": [-0.5, -11, -3.5],
"dilate": 0.5,
"dilate": "#corona_inner_dilate",
"taper": 0.4
},
{
"type": "mson:cone",
"size": [1, 3, 1],
"from": [-0.5, -11, -3.5],
"dilate": 0.8,
"dilate": "#corona_outer_dilate",
"taper": 0.4
}
]

View file

@ -0,0 +1,75 @@
{
"texture": {"w": 64, "h": 64},
"data": {
"tail": {
"texture": {"u": 32, "v": 0},
"pivot": [0, 3, 17],
"cubes": [
{ "from": [-1, -1, -1], "size": [2, 4, 2], "dilate": 0.3 }
],
"children": {
"tail2": {
"texture": {"u": 32, "v": 0},
"pivot": [0, 3, 0],
"cubes": [
{ "from": [-1, -1, -1], "size": [2, 4, 2] }
],
"children": {
"tail3": {
"texture": {"u": 32, "v": 0},
"pivot": [0, 3, 0],
"cubes": [
{ "from": [-1, -1, -1], "size": [2, 4, 2], "dilate": -0.2 }
],
"children": {
"tail4": {
"texture": {"u": 32, "v": 0},
"pivot": [0, 3, 0],
"cubes": [
{ "from": [-1, -1, -1], "size": [2, 4, 2], "dilate": -0.3 }
],
"children": {
"tail5": {
"texture": {"u": 32, "v": 0},
"pivot": [0, 3, 0],
"cubes": [
{ "from": [-1, -1, -1], "size": [2, 4, 2], "dilate": -0.4 }
],
"children": {
"tail6": {
"texture": {"u": 32, "v": 0},
"pivot": [0, 3, 0],
"cubes": [
{ "from": [-1, -1, -1], "size": [2, 4, 2], "dilate": -0.4 }
],
"children": {
"flare_x": {
"texture": {"u": 33, "v": 6},
"pivot": [0, 2, -1],
"rotate": [0,-20,90],
"cubes": [
{ "from": [0, 0, 0], "size": [4, 0.001, 2] }
]
},
"flare_z": {
"texture": {"u": 33, "v": 6},
"pivot": [-1, 2, 0],
"rotate": [90,-20,90],
"cubes": [
{ "from": [0, 0, 0], "size": [4, 0.001, 2] }
]
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}

View file

@ -1,3 +1,8 @@
{
"parent": "minelittlepony:races/alex/unicorn"
"parent": "minelittlepony:races/alex/kirin",
"locals": {
"arm_width": 3,
"arm_rotation_x": 2,
"arm_rotation_y": 8.5
}
}

View file

@ -1,3 +1,60 @@
{
"parent": "minelittlepony:races/steve/unicorn"
"parent": "minelittlepony:races/steve/unicorn",
"data": {
"head": {
"pivot": [ 0, 0, -2 ],
"cubes": [
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
],
"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",
"locals": {
"ear_pronouncement": 0.9,
"ear_spread": 3
},
"data": "minelittlepony:components/ears"
},
"horn": {
"type": "mson:slot",
"name": "horn",
"implementation": "com.minelittlepony.client.model.part.UnicornHorn",
"locals": {
"incline": 19,
"scale": 0.5
},
"data": "minelittlepony:components/horn"
}
}
},
"body": {
"texture": { "u": 16, "v": 16 },
"cubes": [
{ "from": [-4, 4, -2], "size": [ 8, 8, 4] }
],
"children": {
"beard": {
"pivot": [-4, 2, -2],
"rotate": [-20, 0, 0],
"cubes": [
{ "from": [0, 0, 0], "size": [ 8, 8, 4], "dilate": [0.5, -0.5, 0] }
]
}
}
},
"tail": {
"type": "mson:slot",
"name": "tail",
"implementation": "com.minelittlepony.client.model.part.LionTail",
"data": "minelittlepony:components/lion_tail"
}
}
}