mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 15:37:59 +01:00
Fixed load order not visiting old pony textures before the rest
This commit is contained in:
parent
5d88aedfbf
commit
982a393558
3 changed files with 8 additions and 8 deletions
|
@ -42,16 +42,16 @@ public class DefaultArmourTextureResolver<T extends LivingEntity> implements IAr
|
||||||
|
|
||||||
String customType = type.isEmpty() ? "" : String.format("_%s", type);
|
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 res = 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 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 pony = ponifyResource(human);
|
||||||
|
|
||||||
Identifier oldHuman = getArmorTexture(oldPonyRes, type);
|
Identifier oldHuman = getArmorTexture(oldRes, type);
|
||||||
Identifier oldPony = ponifyResource(oldHuman);
|
Identifier oldPony = ponifyResource(oldHuman);
|
||||||
|
|
||||||
return resolve(pony, oldPony, oldHuman, human);
|
return resolve(oldPony, pony, oldHuman, human);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Identifier resolve(Identifier... resources) {
|
private Identifier resolve(Identifier... resources) {
|
||||||
|
|
|
@ -27,7 +27,7 @@ import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
|
public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
|
||||||
|
|
||||||
private static final IArmourTextureResolver<LivingEntity> textures = new DefaultArmourTextureResolver<>();
|
public static final IArmourTextureResolver<LivingEntity> DEFAULT = new DefaultArmourTextureResolver<>();
|
||||||
|
|
||||||
public ArmourFeature(IPonyRenderContext<T, M> renderer) {
|
public ArmourFeature(IPonyRenderContext<T, M> renderer) {
|
||||||
super(renderer);
|
super(renderer);
|
||||||
|
@ -58,7 +58,7 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
|
||||||
armour.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch);
|
armour.setAngles(entity, limbAngle, limbDistance, age, headYaw, headPitch);
|
||||||
armour.synchroniseLegs(pony.getBody());
|
armour.synchroniseLegs(pony.getBody());
|
||||||
|
|
||||||
IArmourTextureResolver<T> resolver = armour instanceof IArmourTextureResolver ? (IArmourTextureResolver<T>)armour : (IArmourTextureResolver<T>)textures;
|
IArmourTextureResolver<T> resolver = armour instanceof IArmourTextureResolver ? (IArmourTextureResolver<T>)armour : (IArmourTextureResolver<T>)DEFAULT;
|
||||||
|
|
||||||
Identifier armourTexture = resolver.getArmourTexture(entity, itemstack, armorSlot, layer, null);
|
Identifier armourTexture = resolver.getArmourTexture(entity, itemstack, armorSlot, layer, null);
|
||||||
armour.setVariant(resolver.getArmourVariant(layer, armourTexture));
|
armour.setVariant(resolver.getArmourVariant(layer, armourTexture));
|
||||||
|
|
Loading…
Reference in a new issue