From 982a393558548da8d60e916bc13ed50160ed2162 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 17 Apr 2020 15:30:31 +0200 Subject: [PATCH] Fixed load order not visiting old pony textures before the rest --- .../model/armour/DefaultArmourTextureResolver.java | 10 +++++----- .../client/render/entity/feature/ArmourFeature.java | 4 ++-- .../model/armour/IArmourTextureResolver.java | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java b/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java index 5c70a275..62fdb844 100644 --- a/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java +++ b/src/main/java/com/minelittlepony/client/model/armour/DefaultArmourTextureResolver.java @@ -42,16 +42,16 @@ public class DefaultArmourTextureResolver implements IAr String customType = type.isEmpty() ? "" : String.format("_%s", type); - String ponyRes = String.format("%s:textures/models/armor/%s_layer_%s%s.png", domain, texture, layer.name().toLowerCase(), customType); - String oldPonyRes = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, layer == ArmourLayer.INNER ? 2 : 1, customType); + String res = String.format("%s:textures/models/armor/%s_layer_%s%s.png", domain, texture, layer.name().toLowerCase(), customType); + String oldRes = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, layer == ArmourLayer.INNER ? 2 : 1, customType); - Identifier human = getArmorTexture(ponyRes, type); + Identifier human = getArmorTexture(res, type); Identifier pony = ponifyResource(human); - Identifier oldHuman = getArmorTexture(oldPonyRes, type); + Identifier oldHuman = getArmorTexture(oldRes, type); Identifier oldPony = ponifyResource(oldHuman); - return resolve(pony, oldPony, oldHuman, human); + return resolve(oldPony, pony, oldHuman, human); } private Identifier resolve(Identifier... resources) { 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 0512fb34..8ffed01d 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 @@ -27,7 +27,7 @@ import net.minecraft.util.Identifier; public class ArmourFeature & IPonyModel> extends AbstractPonyFeature { - private static final IArmourTextureResolver textures = new DefaultArmourTextureResolver<>(); + public static final IArmourTextureResolver DEFAULT = new DefaultArmourTextureResolver<>(); public ArmourFeature(IPonyRenderContext renderer) { super(renderer); @@ -58,7 +58,7 @@ public class ArmourFeature & IP armour.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch); armour.synchroniseLegs(pony.getBody()); - IArmourTextureResolver resolver = armour instanceof IArmourTextureResolver ? (IArmourTextureResolver)armour : (IArmourTextureResolver)textures; + IArmourTextureResolver resolver = armour instanceof IArmourTextureResolver ? (IArmourTextureResolver)armour : (IArmourTextureResolver)DEFAULT; Identifier armourTexture = resolver.getArmourTexture(entity, itemstack, armorSlot, layer, null); armour.setVariant(resolver.getArmourVariant(layer, armourTexture)); diff --git a/src/main/java/com/minelittlepony/model/armour/IArmourTextureResolver.java b/src/main/java/com/minelittlepony/model/armour/IArmourTextureResolver.java index c972e154..8d08ff59 100644 --- a/src/main/java/com/minelittlepony/model/armour/IArmourTextureResolver.java +++ b/src/main/java/com/minelittlepony/model/armour/IArmourTextureResolver.java @@ -12,7 +12,7 @@ public interface IArmourTextureResolver { /** * Gets the armour texture to be used for the given entity, armour piece, slot, and render layer. */ - Identifier getArmourTexture(T entity, ItemStack itemstack, EquipmentSlot slot, ArmourLayer layer, @Nullable String type); + Identifier getArmourTexture(T entity, ItemStack itemstack, EquipmentSlot slot, ArmourLayer layer, @Nullable String type); /** * Gets the armour variant for the identified texture.