mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-25 22:07: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 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) {
|
||||
|
|
|
@ -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> {
|
||||
|
||||
private static final IArmourTextureResolver<LivingEntity> textures = new DefaultArmourTextureResolver<>();
|
||||
public static final IArmourTextureResolver<LivingEntity> DEFAULT = new DefaultArmourTextureResolver<>();
|
||||
|
||||
public ArmourFeature(IPonyRenderContext<T, M> 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.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);
|
||||
armour.setVariant(resolver.getArmourVariant(layer, armourTexture));
|
||||
|
|
|
@ -12,7 +12,7 @@ public interface IArmourTextureResolver<T extends LivingEntity> {
|
|||
/**
|
||||
* 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.
|
||||
|
|
Loading…
Reference in a new issue