diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java b/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java index da75b936..8b2f1683 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/NpcClothingFeature.java @@ -13,10 +13,8 @@ import net.minecraft.client.render.entity.model.EntityModel; import net.minecraft.client.render.entity.model.ModelWithHat; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; -import net.minecraft.resource.ReloadableResourceManager; -import net.minecraft.resource.Resource; import net.minecraft.resource.ResourceManager; -import net.minecraft.resource.SynchronousResourceReloadListener; +import net.minecraft.resource.Resource; import net.minecraft.util.Identifier; import net.minecraft.util.Util; import net.minecraft.util.math.MathHelper; @@ -37,7 +35,7 @@ import java.util.Map; class NpcClothingFeature< T extends LivingEntity & VillagerDataContainer, M extends EntityModel & IPonyModel & ModelWithHat, - C extends FeatureRendererContext & IPonyRenderContext> extends AbstractPonyFeature implements SynchronousResourceReloadListener { + C extends FeatureRendererContext & IPonyRenderContext> extends AbstractPonyFeature { private static final Int2ObjectMap LEVEL_TO_ID = Util.create(new Int2ObjectOpenHashMap<>(), a -> { a.put(1, new Identifier("stone")); @@ -52,13 +50,11 @@ class NpcClothingFeature< private final String entityType; - private final ReloadableResourceManager resourceManager; + private final ResourceManager resourceManager = MinecraftClient.getInstance().getResourceManager(); public NpcClothingFeature(C context, String type) { super(context); entityType = type; - resourceManager = (ReloadableResourceManager)MinecraftClient.getInstance().getResourceManager(); - resourceManager.registerListener(this); } public static Identifier getClothingTexture(VillagerDataContainer entity, String entityType) { @@ -131,12 +127,6 @@ class NpcClothingFeature< }); } - @Override - public void apply(ResourceManager manager) { - profHatCache.clear(); - typeHatCache.clear(); - } - public Identifier findTexture(String category, Identifier identifier) { return new Identifier("minelittlepony", "textures/entity/" + entityType + "/" + category + "/" + identifier.getPath() + ".png"); } diff --git a/src/main/java/com/minelittlepony/client/render/entity/npc/PonyTextures.java b/src/main/java/com/minelittlepony/client/render/entity/npc/PonyTextures.java index 9dfffe02..91d10654 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/npc/PonyTextures.java +++ b/src/main/java/com/minelittlepony/client/render/entity/npc/PonyTextures.java @@ -2,9 +2,7 @@ package com.minelittlepony.client.render.entity.npc; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.LivingEntity; -import net.minecraft.resource.ReloadableResourceManager; import net.minecraft.resource.ResourceManager; -import net.minecraft.resource.SynchronousResourceReloadListener; import net.minecraft.util.Identifier; import net.minecraft.village.VillagerData; import net.minecraft.village.VillagerDataContainer; @@ -20,7 +18,7 @@ import java.util.Optional; /** * Cached pool of villager textures. */ -public class PonyTextures implements TextureSupplier, SynchronousResourceReloadListener { +public class PonyTextures implements TextureSupplier { private final TextureSupplier formatter; @@ -31,7 +29,7 @@ public class PonyTextures implem private final Identifier egg; private final Identifier egg2; - private final ReloadableResourceManager resourceManager; + private final ResourceManager resourceManager = MinecraftClient.getInstance().getResourceManager(); /** * Creates a new profession cache @@ -41,18 +39,10 @@ public class PonyTextures implem * @param fallback The default if any generated textures fail to load. This is stored in place of failing textures. */ public PonyTextures(TextureSupplier formatter) { - this.resourceManager = (ReloadableResourceManager)MinecraftClient.getInstance().getResourceManager(); this.formatter = formatter; this.fallback = formatter.supplyTexture("villager_pony"); this.egg = formatter.supplyTexture("silly_pony"); this.egg2 = formatter.supplyTexture("tiny_silly_pony"); - - resourceManager.registerListener(this); - } - - @Override - public void apply(ResourceManager manager) { - cache.clear(); } @Override