From cc1f323b958f02606d910fe003f9340a2e84f7af Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 21 Mar 2023 21:38:32 +0000 Subject: [PATCH] Implement armour trims --- .../api/model/armour/ArmorModelRegistry.java | 7 -- .../api/model/armour/ArmourLayer.java | 4 + .../api/model/armour/ArmourVariant.java | 23 +++- .../api/model/armour/IArmourModel.java | 19 +-- .../client/model/ModelType.java | 6 +- .../client/model/ModelWrapper.java | 4 +- .../client/model/armour/PonyArmourModel.java | 114 +++++------------- .../model/entity/race/SeaponyModel.java | 10 +- .../render/entity/feature/ArmourFeature.java | 101 +++++++++------- .../models/entity/armor/inner_pony_armor.json | 70 +---------- .../entity/armor/inner_vanilla_armor.json | 73 +++++++++++ .../models/entity/armor/outer_pony_armor.json | 11 +- .../entity/armor/outer_vanilla_armor.json | 4 + 13 files changed, 216 insertions(+), 230 deletions(-) create mode 100644 src/main/resources/assets/minelittlepony/models/entity/armor/inner_vanilla_armor.json create mode 100644 src/main/resources/assets/minelittlepony/models/entity/armor/outer_vanilla_armor.json diff --git a/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java b/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java index d424584e..2d062a40 100644 --- a/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java +++ b/src/main/java/com/minelittlepony/api/model/armour/ArmorModelRegistry.java @@ -4,7 +4,6 @@ import net.minecraft.item.Item; import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import com.minelittlepony.client.model.ModelType; import com.minelittlepony.client.model.armour.PonyArmourModel; import com.minelittlepony.mson.api.ModelKey; import com.minelittlepony.mson.api.Mson; @@ -12,8 +11,6 @@ import com.minelittlepony.mson.api.Mson; import java.util.*; public interface ArmorModelRegistry { - static final Optional>> DEFAULT_INNER = Optional.of(ModelType.INNER_ARMOR); - static final Optional>> DEFAULT_OUTER = Optional.of(ModelType.OUTER_ARMOR); static final Map>>> REGISTRY = new HashMap<>(); public static Optional>> getModelKey(Item item, ArmourLayer layer) { @@ -25,8 +22,4 @@ public interface ArmorModelRegistry { return Optional.of(Mson.getInstance().registerModel(i, PonyArmourModel::new)); }).filter(key -> key.getModelData().isPresent()); } - - public static Optional>> getDefault(ArmourLayer layer) { - return layer == ArmourLayer.INNER ? DEFAULT_INNER : DEFAULT_OUTER; - } } diff --git a/src/main/java/com/minelittlepony/api/model/armour/ArmourLayer.java b/src/main/java/com/minelittlepony/api/model/armour/ArmourLayer.java index bbaafadb..7fd8afec 100644 --- a/src/main/java/com/minelittlepony/api/model/armour/ArmourLayer.java +++ b/src/main/java/com/minelittlepony/api/model/armour/ArmourLayer.java @@ -16,4 +16,8 @@ public enum ArmourLayer { public int getLegacyId() { return ordinal() + 1; } + + public boolean isInner() { + return this == INNER; + } } \ No newline at end of file diff --git a/src/main/java/com/minelittlepony/api/model/armour/ArmourVariant.java b/src/main/java/com/minelittlepony/api/model/armour/ArmourVariant.java index ab4a3d82..dea90d53 100644 --- a/src/main/java/com/minelittlepony/api/model/armour/ArmourVariant.java +++ b/src/main/java/com/minelittlepony/api/model/armour/ArmourVariant.java @@ -1,6 +1,25 @@ package com.minelittlepony.api.model.armour; +import com.minelittlepony.client.model.ModelType; +import com.minelittlepony.client.model.armour.PonyArmourModel; +import com.minelittlepony.mson.api.ModelKey; + +import java.util.Optional; + public enum ArmourVariant { - NORMAL, - LEGACY + NORMAL(ModelType.INNER_PONY_ARMOR, ModelType.OUTER_PONY_ARMOR), + LEGACY(ModelType.INNER_VANILLA_ARMOR, ModelType.OUTER_VANILLA_ARMOR), + TRIM(ModelType.INNER_VANILLA_ARMOR, ModelType.OUTER_VANILLA_ARMOR); + + private final Optional>> innerModel; + private final Optional>> outerModel; + + ArmourVariant(ModelKey> inner, ModelKey> outer) { + this.innerModel = Optional.of(inner); + this.outerModel = Optional.of(outer); + } + + public Optional>> getDefaultModel(ArmourLayer layer) { + return layer.isInner() ? innerModel : outerModel; + } } diff --git a/src/main/java/com/minelittlepony/api/model/armour/IArmourModel.java b/src/main/java/com/minelittlepony/api/model/armour/IArmourModel.java index cd438975..454680b7 100644 --- a/src/main/java/com/minelittlepony/api/model/armour/IArmourModel.java +++ b/src/main/java/com/minelittlepony/api/model/armour/IArmourModel.java @@ -1,24 +1,17 @@ package com.minelittlepony.api.model.armour; import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; -import com.minelittlepony.api.model.IModel; +import com.minelittlepony.client.model.IPonyModel; -public interface IArmourModel { +public interface IArmourModel { /** * Called to synchronise this armour's angles with that of another. * * @param model The other model to mimic */ - void synchroniseAngles(IModel model); - - /** - * Prepares an armour model for rendering, first hiding all the pieces and then incrementally showing them as appropriate. - * - * @param slot The armour slot being rendered - * @param layer The layer. INNER/OUTER - * - * @return false to skip this render pass. - */ - boolean setVisibilities(EquipmentSlot slot, ArmourLayer layer, ArmourVariant variant); + boolean poseModel(T entity, float limbAngle, float limbDistance, float age, float headYaw, float headPitch, + EquipmentSlot slot, ArmourLayer layer, + IPonyModel mainModel); } diff --git a/src/main/java/com/minelittlepony/client/model/ModelType.java b/src/main/java/com/minelittlepony/client/model/ModelType.java index 5d24c056..09556292 100644 --- a/src/main/java/com/minelittlepony/client/model/ModelType.java +++ b/src/main/java/com/minelittlepony/client/model/ModelType.java @@ -52,8 +52,10 @@ public final class ModelType { public static final ModelKey> ELYTRA = register("elytra", PonyElytra::new); public static final ModelKey ARMOUR_STAND = register("armour_stand", PonyArmourStandModel::new); - public static final ModelKey> INNER_ARMOR = register("armor/inner_pony_armor", PonyArmourModel::new); - public static final ModelKey> OUTER_ARMOR = register("armor/outer_pony_armor", PonyArmourModel::new); + public static final ModelKey> INNER_VANILLA_ARMOR = register("armor/inner_vanilla_armor", PonyArmourModel::new); + public static final ModelKey> OUTER_VANILLA_ARMOR = register("armor/outer_vanilla_armor", PonyArmourModel::new); + public static final ModelKey> INNER_PONY_ARMOR = register("armor/inner_pony_armor", PonyArmourModel::new); + public static final ModelKey> OUTER_PONY_ARMOR = register("armor/outer_pony_armor", PonyArmourModel::new); public static final GearModelKey STETSON = registerGear("stetson", Wearable.STETSON, Stetson::new); public static final GearModelKey SADDLEBAGS_BOTH = registerGear("saddlebags", Wearable.SADDLE_BAGS_BOTH, t -> new SaddleBags(t, Wearable.SADDLE_BAGS_BOTH)); diff --git a/src/main/java/com/minelittlepony/client/model/ModelWrapper.java b/src/main/java/com/minelittlepony/client/model/ModelWrapper.java index 7bef4178..5668b927 100644 --- a/src/main/java/com/minelittlepony/client/model/ModelWrapper.java +++ b/src/main/java/com/minelittlepony/client/model/ModelWrapper.java @@ -43,8 +43,8 @@ public class ModelWrapper implements I return body; } - public Optional> getArmourModel(ItemStack stack, ArmourLayer layer) { - return ArmorModelRegistry.getModelKey(stack.getItem(), layer).or(() -> ArmorModelRegistry.getDefault(layer).filter(l -> stack.getItem() instanceof ArmorItem)) + public Optional> getArmourModel(ItemStack stack, ArmourLayer layer, ArmourVariant variant) { + return ArmorModelRegistry.getModelKey(stack.getItem(), layer).or(() -> variant.getDefaultModel(layer).filter(l -> stack.getItem() instanceof ArmorItem)) .map(key -> armor.computeIfAbsent(key, k -> { return armorFactory == null ? k.createModel() : k.createModel(armorFactory); })); diff --git a/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java b/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java index cd1f07c5..5704db79 100644 --- a/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java +++ b/src/main/java/com/minelittlepony/client/model/armour/PonyArmourModel.java @@ -5,108 +5,50 @@ import net.minecraft.client.render.entity.model.BipedEntityModel; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; -import com.minelittlepony.api.model.IModel; import com.minelittlepony.api.model.armour.*; import com.minelittlepony.client.model.AbstractPonyModel; +import com.minelittlepony.client.model.IPonyModel; -public class PonyArmourModel extends AbstractPonyModel implements IArmourModel { - - private ModelPart chestPiece; - - private ModelPart steveRightLeg; - private ModelPart steveLeftLeg; +public class PonyArmourModel extends AbstractPonyModel implements IArmourModel { public PonyArmourModel(ModelPart tree) { super(tree); - chestPiece = tree.getChild("chestpiece"); - steveRightLeg = tree.getChild("steve_right_leg"); - steveLeftLeg = tree.getChild("steve_left_leg"); - - bodyRenderList.clear(); - bodyRenderList.add(body, chestPiece); - legsRenderList.add(steveLeftLeg, steveRightLeg); - } - - public IArmourTextureResolver getArmourTextureResolver() { - return DefaultArmourTextureResolver.INSTANCE; } @Override - protected void adjustBodyComponents(float rotateAngleX, float rotationPointY, float rotationPointZ) { - super.adjustBodyComponents(rotateAngleX, rotationPointY, rotationPointZ); + public boolean poseModel(T entity, float limbAngle, float limbDistance, float age, float headYaw, float headPitch, + EquipmentSlot slot, ArmourLayer layer, + IPonyModel mainModel) { - chestPiece.pitch = rotateAngleX; - chestPiece.pivotY = rotationPointY; - chestPiece.pivotZ = rotationPointZ; - } - - @Override - public void synchroniseAngles(IModel model) { - if (model instanceof BipedEntityModel) { - @SuppressWarnings("unchecked") - BipedEntityModel mainModel = (BipedEntityModel)model; - head.copyTransform(mainModel.head); - head.copyTransform(mainModel.head); - - body.copyTransform(mainModel.body); - rightArm.copyTransform(mainModel.rightArm); - leftArm.copyTransform(mainModel.leftArm); - rightLeg.copyTransform(mainModel.rightLeg); - leftLeg.copyTransform(mainModel.leftLeg); - - steveLeftLeg.copyTransform(mainModel.leftLeg); - steveRightLeg.copyTransform(mainModel.rightLeg); + if (!setVisibilities(slot, layer)) { + return false; } + mainModel.copyAttributes(this); + setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch); + if (mainModel instanceof BipedEntityModel biped) { + head.copyTransform(biped.head); + body.copyTransform(biped.body); + rightArm.copyTransform(biped.rightArm); + leftArm.copyTransform(biped.leftArm); + rightLeg.copyTransform(biped.rightLeg); + leftLeg.copyTransform(biped.leftLeg); + } + return true; } - @Override - public boolean setVisibilities(EquipmentSlot slot, ArmourLayer layer, ArmourVariant variant) { + public boolean setVisibilities(EquipmentSlot slot, ArmourLayer layer) { setVisible(false); - chestPiece.visible = false; - head.visible = false; - neck.visible = false; - steveLeftLeg.visible = false; - steveRightLeg.visible = false; + body.visible = slot == EquipmentSlot.CHEST; + head.visible = layer == ArmourLayer.OUTER && slot == EquipmentSlot.HEAD; - switch (layer) { - case OUTER: - switch (slot) { - case HEAD: - head.visible = true; - return true; - case FEET: - showLeggings(layer, variant); - return true; - case CHEST: - body.visible = variant == ArmourVariant.LEGACY; - chestPiece.visible = variant == ArmourVariant.NORMAL; - return true; - default: - return false; - } - case INNER: - switch (slot) { - case LEGS: - showLeggings(layer, variant); - return true; - case CHEST: - body.visible = variant == ArmourVariant.LEGACY; - chestPiece.visible = variant == ArmourVariant.NORMAL; - return true; - default: - return false; - } - default: - return false; + if (slot == (layer == ArmourLayer.OUTER ? EquipmentSlot.FEET : EquipmentSlot.LEGS)) { + rightArm.visible = true; + leftArm.visible = true; + rightLeg.visible = true; + leftLeg.visible = true; + return true; } - } - protected void showLeggings(ArmourLayer layer, ArmourVariant variant) { - rightArm.visible = true; - leftArm.visible = true; - rightLeg.visible = variant == ArmourVariant.NORMAL; - leftLeg.visible = variant == ArmourVariant.NORMAL; - steveLeftLeg.visible = variant == ArmourVariant.LEGACY; - steveRightLeg.visible = variant == ArmourVariant.LEGACY; + return head.visible || body.visible; } } diff --git a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java index fba425db..1f7799ab 100644 --- a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java +++ b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java @@ -4,11 +4,11 @@ import com.minelittlepony.client.model.armour.PonyArmourModel; import com.minelittlepony.mson.api.ModelView; import com.minelittlepony.api.model.*; import com.minelittlepony.api.model.armour.ArmourLayer; -import com.minelittlepony.api.model.armour.ArmourVariant; import com.minelittlepony.api.pony.IPony; import net.minecraft.client.model.ModelPart; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; import net.minecraft.util.math.MathHelper; @@ -133,9 +133,11 @@ public class SeaponyModel extends UnicornModel { } @Override - public void showLeggings(ArmourLayer layer, ArmourVariant variant) { - rightArm.visible = true; - leftArm.visible = true; + public boolean setVisibilities(EquipmentSlot slot, ArmourLayer layer) { + boolean result = super.setVisibilities(slot, layer); + rightLeg.visible = false; + leftLeg.visible = false; + return result; } @Override diff --git a/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java b/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java index 192aed22..5ae72b51 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/feature/ArmourFeature.java @@ -3,27 +3,29 @@ package com.minelittlepony.client.render.entity.feature; import com.minelittlepony.api.model.armour.*; import com.minelittlepony.client.model.IPonyModel; import com.minelittlepony.client.model.ModelWrapper; -import com.minelittlepony.client.model.armour.PonyArmourModel; +import com.minelittlepony.client.model.armour.DefaultArmourTextureResolver; import com.minelittlepony.client.render.IPonyRenderContext; import com.minelittlepony.common.util.Color; -import net.minecraft.client.render.OverlayTexture; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.render.entity.model.EntityModel; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.*; +import net.minecraft.client.render.entity.model.*; import net.minecraft.client.render.item.ItemRenderer; +import net.minecraft.client.render.model.BakedModelManager; +import net.minecraft.client.texture.Sprite; +import net.minecraft.client.texture.SpriteAtlasTexture; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; import net.minecraft.item.*; +import net.minecraft.item.trim.ArmorTrim; +import net.minecraft.resource.featuretoggle.FeatureFlags; import net.minecraft.util.Identifier; public class ArmourFeature & IPonyModel> extends AbstractPonyFeature { - public ArmourFeature(IPonyRenderContext renderer) { - super(renderer); + public ArmourFeature(IPonyRenderContext context, BakedModelManager bakery) { + super(context); } @Override @@ -38,66 +40,77 @@ public class ArmourFeature & IP } } - public static & IArmourModel> void renderArmor( - ModelWrapper> pony, MatrixStack stack, - VertexConsumerProvider renderContext, int lightUv, T entity, + public static & IArmourModel> void renderArmor( + ModelWrapper> pony, MatrixStack matrices, + VertexConsumerProvider renderContext, int light, T entity, float limbDistance, float limbAngle, float age, float headYaw, float headPitch, EquipmentSlot armorSlot, ArmourLayer layer) { - ItemStack itemstack = entity.getEquippedStack(armorSlot); + ItemStack stack = entity.getEquippedStack(armorSlot); - if (itemstack.isEmpty()) { + if (stack.isEmpty()) { return; } - PonyArmourModel model = pony.getArmourModel(itemstack, layer).orElse(null); - if (model == null) { - return; - } + IArmourTextureResolver resolver = DefaultArmourTextureResolver.INSTANCE; + Identifier texture = resolver.getTexture(entity, stack, armorSlot, layer, null); + ArmourVariant variant = resolver.getVariant(layer, texture); - IArmourTextureResolver resolver = model.getArmourTextureResolver(); - - boolean glint = itemstack.hasGlint(); - - Identifier texture = resolver.getTexture(entity, itemstack, armorSlot, layer, null); - - Item item = itemstack.getItem(); - - if (model.setVisibilities(armorSlot, layer, resolver.getVariant(layer, texture))) { - model.setMetadata(pony.body().getMetadata()); - - pony.body().copyAttributes(model); - model.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch); - model.synchroniseAngles(pony.body()); + boolean glint = stack.hasGlint(); + Item item = stack.getItem(); + pony.getArmourModel(stack, layer, variant) + .filter(m -> m.poseModel(entity, limbAngle, limbDistance, age, headYaw, headPitch, armorSlot, layer, pony.body())) + .ifPresent(model -> { float red = 1; float green = 1; float blue = 1; - if (item instanceof DyeableArmorItem) { - int color = ((DyeableArmorItem)item).getColor(itemstack); + if (item instanceof DyeableArmorItem dyeable) { + int color = dyeable.getColor(stack); red = Color.r(color); green = Color.g(color); blue = Color.b(color); } - renderArmourPart(stack, renderContext, lightUv, glint, model, red, green, blue, texture); + model.render(matrices, getArmorConsumer(renderContext, texture, glint), light, OverlayTexture.DEFAULT_UV, red, green, blue, 1); + if (item instanceof DyeableArmorItem) { - texture = resolver.getTexture(entity, itemstack, armorSlot, layer, "overlay"); - if (model.setVisibilities(armorSlot, layer, resolver.getVariant(layer, texture))) { - renderArmourPart(stack, renderContext, lightUv, false, model, 1, 1, 1, texture); + Identifier tex = resolver.getTexture(entity, stack, armorSlot, layer, "overlay"); + pony.getArmourModel(stack, layer, resolver.getVariant(layer, tex)) + .filter(m -> m.poseModel(entity, limbAngle, limbDistance, age, headYaw, headPitch, armorSlot, layer, pony.body())) + .ifPresent(m -> { + m.render(matrices, getArmorConsumer(renderContext, tex, false), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); + }); + } + + if (entity.world.getEnabledFeatures().contains(FeatureFlags.UPDATE_1_20)) { + if (stack.getItem() instanceof ArmorItem armor) { + ArmorTrim.getTrim(entity.world.getRegistryManager(), stack).ifPresent(trim -> { + pony.getArmourModel(stack, layer, ArmourVariant.TRIM) + .filter(m -> m.poseModel(entity, limbAngle, limbDistance, age, headYaw, headPitch, armorSlot, layer, pony.body())) + .ifPresent(m -> { + m.render(matrices, getTrimConsumer(renderContext, armor.getMaterial(), trim, layer, glint), light, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1); + }); + }); } } - } + }); } - private static & IArmourModel> void renderArmourPart( - MatrixStack matrices, VertexConsumerProvider provider, - int light, boolean glint, V model, float r, float g, float b, Identifier texture) { + private static VertexConsumer getArmorConsumer(VertexConsumerProvider provider, Identifier texture, boolean glint) { + return ItemRenderer.getArmorGlintConsumer(provider, RenderLayer.getArmorCutoutNoCull(texture), false, glint); + } - VertexConsumer vertices = ItemRenderer.getArmorGlintConsumer(provider, RenderLayer.getArmorCutoutNoCull(texture), false, glint); + private static VertexConsumer getTrimConsumer(VertexConsumerProvider provider, ArmorMaterial material, ArmorTrim trim, ArmourLayer layer, boolean glint) { + SpriteAtlasTexture armorTrimsAtlas = MinecraftClient.getInstance().getBakedModelManager().getAtlas(TexturedRenderLayers.ARMOR_TRIMS_ATLAS_TEXTURE); + Sprite sprite = armorTrimsAtlas.getSprite( + layer == ArmourLayer.INNER ? trim.getLeggingsModelId(material) : trim.getGenericModelId(material) + ); - model.render(matrices, vertices, light, OverlayTexture.DEFAULT_UV, r, g, b, 1); + return sprite.getTextureSpecificVertexConsumer( + ItemRenderer.getDirectItemGlintConsumer(provider, TexturedRenderLayers.getArmorTrims(), true, glint) + ); } } diff --git a/src/main/resources/assets/minelittlepony/models/entity/armor/inner_pony_armor.json b/src/main/resources/assets/minelittlepony/models/entity/armor/inner_pony_armor.json index e1207ac3..74c00db1 100644 --- a/src/main/resources/assets/minelittlepony/models/entity/armor/inner_pony_armor.json +++ b/src/main/resources/assets/minelittlepony/models/entity/armor/inner_pony_armor.json @@ -1,59 +1,12 @@ { - "parent": "minelittlepony:steve_pony", - "texture": {"w": 64, "h": 32}, - "dilate": 0.2, + "parent": "minelittlepony:armor/inner_vanilla_armor", "data": { "body": { - "texture": { "u": 16, "v": 18 }, - "cubes": [ - { "from": [-4, 4, -2], "size": [ 8, 8, 4] } - ], - "children": { - "upper_torso": { - "type": "mson:planar", - "texture": {"u": 24, "v": 0}, - "east": [ 4, 4, 2, 8, 8, 32, 23], - "west": [ -4, 4, 2, 8, 8, 32, 23], - "south": [-4, 4, 10, 8, 8, 32, 23], - "up": [ -4, 4, 1, 8, 12, 32, 23], - "__comment": "it's a little short, so the butt tends to show. :/" - } - } - }, - "chestpiece": { "texture": {"u": 16, "v": 8}, "cubes": [ {"from": [-4, 4, -2], "size": [8, 8, 16]} ] }, - "head": { - "cubes": [ - { "from": [-4, -6, -6], "size": [ 8, 8, 8], "dilate": 0.5 }, - { "from": [-4, -8, -1], "size": [ 2, 2, 2], "texture": {"u": 0, "v": 0}, "dilate": -0.0125 }, - { "from": [ 2, -8, -1], "size": [ 2, 2, 2], "texture": {"u": 0, "v": 4}, "dilate": -0.0125 } - ] - }, - "right_arm": { - "pivot": ["#arm_rotation_x_neg", "#arm_rotation_y", 0], - "texture": { "u": 0, "v": 16 }, - "cubes": [ - { - "from": [ "#arm_x_neg", 4, "#arm_z"], - "size": [ "#arm_width", "#arm_length", "#arm_depth" ] - } - ] - }, - "left_arm": { - "pivot": ["#arm_rotation_x", "#arm_rotation_y", 0], - "mirror": true, - "texture": { "u": 0, "v": 16 }, - "cubes": [ - { - "from": [ "#arm_x", 4, "#arm_z"], - "size": [ "#arm_width", "#arm_length", "#arm_depth" ] - } - ] - }, "right_leg": { "pivot": ["#arm_rotation_x_neg", 0, 0], "texture": { "u": 48, "v": 8 }, @@ -74,27 +27,6 @@ "size": [ "#arm_width", "#arm_length", "#arm_depth" ] } ] - }, - "steve_right_leg": { - "pivot": ["#arm_rotation_x_neg", 0, 0], - "texture": { "u": 0, "v": 16 }, - "cubes": [ - { - "from": [ "#arm_x_neg", 4, "#arm_z"], - "size": [ "#arm_width", "#arm_length", "#arm_depth" ] - } - ] - }, - "steve_left_leg": { - "pivot": ["#arm_rotation_x", 0, 0], - "mirror": true, - "texture": { "u": 0, "v": 16 }, - "cubes": [ - { - "from": [ "#arm_x", 4, "#arm_z"], - "size": [ "#arm_width", "#arm_length", "#arm_depth" ] - } - ] } } } diff --git a/src/main/resources/assets/minelittlepony/models/entity/armor/inner_vanilla_armor.json b/src/main/resources/assets/minelittlepony/models/entity/armor/inner_vanilla_armor.json new file mode 100644 index 00000000..e7c36158 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/entity/armor/inner_vanilla_armor.json @@ -0,0 +1,73 @@ +{ + "parent": "minelittlepony:steve_pony", + "texture": {"w": 64, "h": 32}, + "dilate": 0.2, + "data": { + "body": { + "texture": { "u": 16, "v": 18 }, + "cubes": [ + { "from": [-4, 4, -2], "size": [ 8, 8, 4] } + ], + "children": { + "upper_torso": { + "type": "mson:planar", + "texture": {"u": 24, "v": 0}, + "east": [ 4, 4, 2, 8, 8, 32, 23], + "west": [ -4, 4, 2, 8, 8, 32, 23], + "south": [-4, 4, 10, 8, 8, 32, 23], + "up": [ -4, 4, 1, 8, 12, 32, 23], + "__comment": "it's a little short, so the butt tends to show. :/" + } + } + }, + "head": { + "cubes": [ + { "from": [-4, -6, -6], "size": [ 8, 8, 8], "dilate": 0.5 }, + { "from": [-4, -8, -1], "size": [ 2, 2, 2], "texture": {"u": 0, "v": 0}, "dilate": -0.0125 }, + { "from": [ 2, -8, -1], "size": [ 2, 2, 2], "texture": {"u": 0, "v": 4}, "dilate": -0.0125 } + ] + }, + "right_arm": { + "pivot": ["#arm_rotation_x_neg", "#arm_rotation_y", 0], + "texture": { "u": 0, "v": 16 }, + "cubes": [ + { + "from": [ "#arm_x_neg", 4, "#arm_z"], + "size": [ "#arm_width", "#arm_length", "#arm_depth" ] + } + ] + }, + "left_arm": { + "pivot": ["#arm_rotation_x", "#arm_rotation_y", 0], + "mirror": true, + "texture": { "u": 0, "v": 16 }, + "cubes": [ + { + "from": [ "#arm_x", 4, "#arm_z"], + "size": [ "#arm_width", "#arm_length", "#arm_depth" ] + } + ] + }, + "right_leg": { + "pivot": ["#arm_rotation_x_neg", 0, 0], + "texture": { "u": 0, "v": 16 }, + "cubes": [ + { + "from": [ "#arm_x_neg", 4, "#arm_z"], + "size": [ "#arm_width", "#arm_length", "#arm_depth" ] + } + ] + }, + "left_leg": { + "pivot": ["#arm_rotation_x", 0, 0], + "mirror": true, + "texture": { "u": 0, "v": 16 }, + "cubes": [ + { + "from": [ "#arm_x", 4, "#arm_z"], + "size": [ "#arm_width", "#arm_length", "#arm_depth" ] + } + ] + } + } +} diff --git a/src/main/resources/assets/minelittlepony/models/entity/armor/outer_pony_armor.json b/src/main/resources/assets/minelittlepony/models/entity/armor/outer_pony_armor.json index c38bbb07..d87dc3da 100644 --- a/src/main/resources/assets/minelittlepony/models/entity/armor/outer_pony_armor.json +++ b/src/main/resources/assets/minelittlepony/models/entity/armor/outer_pony_armor.json @@ -1,4 +1,13 @@ { "parent": "minelittlepony:armor/inner_pony_armor", - "dilate": 0.4 + "dilate": 0.4, + "data": { + "body": { + "texture": {"u": 16, "v": 8}, + "dilate": 0.41, + "cubes": [ + {"from": [-4, 4, -2], "size": [8, 8, 16]} + ] + } + } } diff --git a/src/main/resources/assets/minelittlepony/models/entity/armor/outer_vanilla_armor.json b/src/main/resources/assets/minelittlepony/models/entity/armor/outer_vanilla_armor.json new file mode 100644 index 00000000..9df74d28 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/entity/armor/outer_vanilla_armor.json @@ -0,0 +1,4 @@ +{ + "parent": "minelittlepony:armor/inner_vanilla_armor", + "dilate": 0.4 +}