diff --git a/src/main/java/com/minelittlepony/client/render/entities/VillagerProfessionTextureCache.java b/src/main/java/com/minelittlepony/client/render/entities/VillagerProfessionTextureCache.java index 7b9ecd31..7f12a19a 100644 --- a/src/main/java/com/minelittlepony/client/render/entities/VillagerProfessionTextureCache.java +++ b/src/main/java/com/minelittlepony/client/render/entities/VillagerProfessionTextureCache.java @@ -74,16 +74,17 @@ class VillagerProfessionTextureCache { - return verifyTexture(formatter.supplyTexture(k)).orElseGet(() -> { - if (type == VillagerType.PLAINS) { - // if texture loading fails, use the fallback. - return fallback; - } + Identifier result = verifyTexture(formatter.supplyTexture(key)).orElseGet(() -> { + if (type == VillagerType.PLAINS) { + // if texture loading fails, use the fallback. + return fallback; + } - return getTexture(VillagerType.PLAINS, profession); - }); + return getTexture(VillagerType.PLAINS, profession); }); + + cache.put(key, result); + return result; } protected Optional verifyTexture(Identifier texture) {