From db6a1f68e1fc30566c0c61da40c93e08bb03918a Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 28 Nov 2019 14:36:55 +0200 Subject: [PATCH] Convert saddlebags to json --- .../client/model/gear/SaddleBags.java | 51 ----------- .../models/components/saddlebags.json | 85 +++++++++++++++++++ 2 files changed, 85 insertions(+), 51 deletions(-) create mode 100644 src/main/resources/assets/minelittlepony/models/components/saddlebags.json diff --git a/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java b/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java index f7bf5f79..327a5b46 100644 --- a/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java +++ b/src/main/java/com/minelittlepony/client/model/gear/SaddleBags.java @@ -1,6 +1,5 @@ package com.minelittlepony.client.model.gear; -import com.minelittlepony.client.util.render.Part; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.IModel; import com.minelittlepony.model.IPegasus; @@ -30,13 +29,8 @@ public class SaddleBags extends AbstractGear { float dropAmount = 0; - private IModel model; - public SaddleBags() { - init(0, 0); - } - @Override public void init(ModelContext context) { strap = context.findByName("strap"); @@ -44,51 +38,6 @@ public class SaddleBags extends AbstractGear { rightBag = context.findByName("right_bag"); } - @Deprecated - public void init(float yOffset, float stretch) { - leftBag = new Part(this, 56, 19); - rightBag = new Part(this, 56, 19); - strap = new Part(this, 56, 19); - - float y = -0.5F; - int x = 4; - int z = -1; - - ((Part)strap).offset(-x, y + 0.2F, z + 3).around(0, 4, 4) - .tex(56, 31).top(0, 0, 0, 8, 1, stretch) - .top(0, 0, 1, 8, 1, stretch) - .south(0, 0, 2, 8, 1, stretch) - .north(0, 0, 0, 8, 1, stretch) - .child(0).offset(0, -3, -0.305F).tex(56, 31) - .west( 4.0002F, 0, 0, 1, 3, stretch) // 0.0001 is there - .west( 4.0002F, -1, 0, 1, 3, stretch) // otherwise straps - .west(-4.0002F, 0, 0, 1, 3, stretch) // clip into the body - .west(-4.0002F, -1, 0, 1, 3, stretch) - .pitch = ROTATE_270; - - ((Part)leftBag).offset(x, y, z).around(0, 4, 4) - .tex(56, 25).south(0, 0, 0, 3, 6, stretch) - .tex(59, 25).south(0, 0, 8, 3, 6, stretch) - .tex(56, 19) .west(3, 0, 0, 6, 8, stretch) - .west(0, 0, 0, 6, 8, stretch) - .child(0).offset(z, y, -x).tex(56, 16) - .top(0, 0, -3, 8, 3, stretch) - .tex(56, 22).flipZ().bottom(0, 6, -3, 8, 3, stretch) - .yaw = ROTATE_270; - - x += 3; - - ((Part)rightBag).offset(-x, y, z).around(0, 4, 4).flipX() - .tex(56, 25).south(0, 0, 0, 3, 6, stretch) - .tex(59, 25).south(0, 0, 8, 3, 6, stretch) - .tex(56, 19).west(3, 0, 0, 6, 8, stretch) - .west(0, 0, 0, 6, 8, stretch) - .child(0).offset(z, y, x).tex(56, 16) - .flipZ().top(0, 0, -3, 8, 3, stretch) - .tex(56, 22).flipZ().bottom(0, 6, -3, 8, 3, stretch) - .yaw = ROTATE_270; - } - @Override public void setLivingAnimations(IModel model, Entity entity) { this.model = model; diff --git a/src/main/resources/assets/minelittlepony/models/components/saddlebags.json b/src/main/resources/assets/minelittlepony/models/components/saddlebags.json new file mode 100644 index 00000000..1db87a2e --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/components/saddlebags.json @@ -0,0 +1,85 @@ +{ + "texture": {"w": 64, "h": 64}, + "left_bag": { + "type": "mson:planar", + "texture": {"u": 56, "v": 19}, + "offset": [4, -0.5, -1], + "center": [0, 4, 4], + "south": [ + [0, 0, 0, 3, 6, 56, 25], + [0, 0, 8, 3, 6, 59, 25] + ], + "west": [ + [3, 0, 0, 6, 8, 56, 19], + [0, 0, 0, 6, 8, 56, 19] + ], + "children": [ + { + "rotate": [270, 0, 0], + "offset": [-1, -0.5, -4], + "top": [0, 0, -3, 8, 3, 56, 16], + "children": [ + { + "type": "mson:plane", + "from": [0, 6, -3], "size": [-3, 8, 3], + "mirror": [false, false, true] + } + ] + } + ] + }, + "right_bag": { + "type": "mson:planar", + "texture": {"u": 56, "v": 19}, + "offset": [-7, -0.5, -1], + "center": [0, 4, 4], + "south": [ + [0, 0, 0, 3, 6, 56, 25], + [0, 0, 8, 3, 6, 59, 25] + ], + "west": [ + [3, 0, 0, 6, 8, 56, 19], + [0, 0, 0, 6, 8, 56, 19] + ], + "children": [ + { + "rotate": [270, 0, 0], + "offset": [-1, -0.5, 7], + "top": [0, 0, -3, 8, 3, 56, 16], + "children": [ + { + "type": "mson:plane", + "from": [0, 6, -3], "size": [-3, 8, 3], + "mirror": [false, false, true] + } + ] + } + ] + }, + "strap": { + "type": "mson:planar", + "texture": {"u": 56, "v": 19}, + "offset": [-4, -0.3, 2], + "center": [0, 4, 4], + "top": [ + [0, 0, 0, 8, 1], + [0, 0, 1, 8, 1] + ], + "south": [0, 0, 2, 8, 1], + "north": [0, 0, 0, 8, 1], + "children": [ + { + "type": "mson:planar", + "offset": [0.0002, -3, -0.305], + "texture": {"u": 56, "v": 31}, + "rotate": [270, 0, 0], + "west": [ + [ 4, 0, 0, 1, 3], + [ 4, -1, 0, 1, 3], + [-4, 0, 0, 1, 3], + [-4, -1, 0, 1, 3] + ] + } + ] + } +}