From 783627f4c52d1ae9b9edee815edca2cae94ae4ce Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:20:57 -0400 Subject: [PATCH] Always convert identity unbaked missing model to identity baked missing model Related: #433 --- .../dynamic_resources/ModelBakeryMixin.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java b/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java index e54eaf8e..03db8e91 100644 --- a/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java +++ b/common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java @@ -116,15 +116,19 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { model = bakedTopLevelModels.get(location); if(model == null) { UnbakedModel prototype = mfix$loadUnbakedModelDynamic(location); - prototype.resolveParents(this::getModel); - if(DEBUG_MODEL_LOADS) { - ModernFix.LOGGER.info("Baking model {}", location); - } - this.method_61072(this.textureGetter, location, prototype); - model = bakedTopLevelModels.remove(location); - if(model == null) { - ModernFix.LOGGER.error("Failed to load model " + location); + if(prototype == missingModel) { model = bakedMissingModel; + } else { + prototype.resolveParents(this::getModel); + if(DEBUG_MODEL_LOADS) { + ModernFix.LOGGER.info("Baking model {}", location); + } + this.method_61072(this.textureGetter, location, prototype); + model = bakedTopLevelModels.remove(location); + if(model == null) { + ModernFix.LOGGER.error("Failed to load model " + location); + model = bakedMissingModel; + } } } } finally {