diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/AbstractNpcRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/npc/AbstractNpcRenderer.java index 3b787ea9..5af152b5 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/AbstractNpcRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/AbstractNpcRenderer.java @@ -27,7 +27,7 @@ abstract class AbstractNpcRenderer private final NpcClothingFeature, AbstractNpcRenderer> clothing; public AbstractNpcRenderer(EntityRendererFactory.Context context, String type, TextureSupplier textureSupplier, TextureSupplier formatter) { - super(context, ModelType.getPlayerModel(Race.EARTH).getKey(false), new SillyPonyTextureSupplier<>(textureSupplier, formatter)); + super(context, ModelType.getPlayerModel(Race.EARTH).getKey(false), SillyPonyTextureSupplier.create(textureSupplier, formatter)); entityType = type; clothing = new NpcClothingFeature<>(this, entityType); addFeature(clothing); diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/textures/SillyPonyTextureSupplier.java b/src/main/java/com/minelittlepony/client/render/entity/npc/textures/SillyPonyTextureSupplier.java index 1750fed8..276a0379 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/textures/SillyPonyTextureSupplier.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/textures/SillyPonyTextureSupplier.java @@ -4,22 +4,13 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.util.Identifier; import net.minecraft.village.VillagerDataContainer; -public class SillyPonyTextureSupplier implements TextureSupplier { - - private final TextureSupplier fallback; - - private final Identifier egg; - private final Identifier egg2; - - public SillyPonyTextureSupplier(TextureSupplier fallback, TextureSupplier formatter) { - this.fallback = fallback; - this.egg = formatter.apply("silly_pony"); - this.egg2 = formatter.apply("tiny_silly_pony"); - } - - @Override - public Identifier apply(T entity) { - return isBestPony(entity) ? (entity.isBaby() ? egg2 : egg) : fallback.apply(entity); +public class SillyPonyTextureSupplier { + public static TextureSupplier create(TextureSupplier fallback, TextureSupplier formatter) { + Identifier egg = formatter.apply("silly_pony"); + Identifier egg2 = formatter.apply("tiny_silly_pony"); + return entity -> { + return isBestPony(entity) ? ("Dinky".equals(entity.getCustomName().getString()) ? egg2 : egg) : fallback.apply(entity); + }; } public static boolean isBestPony(LivingEntity entity) { @@ -27,7 +18,7 @@ public class SillyPonyTextureSupplier