Always convert identity unbaked missing model to identity baked missing model

Related: #433
This commit is contained in:
embeddedt 2024-07-08 19:20:57 -04:00
parent d7bfeedc62
commit 783627f4c5
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -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 {