Skip to content

Commit 783627f

Browse files
committed
Always convert identity unbaked missing model to identity baked missing model
Related: #433
1 parent d7bfeed commit 783627f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,19 @@ private BakedModel loadBakedModelDynamic(ModelResourceLocation location) {
116116
model = bakedTopLevelModels.get(location);
117117
if(model == null) {
118118
UnbakedModel prototype = mfix$loadUnbakedModelDynamic(location);
119-
prototype.resolveParents(this::getModel);
120-
if(DEBUG_MODEL_LOADS) {
121-
ModernFix.LOGGER.info("Baking model {}", location);
122-
}
123-
this.method_61072(this.textureGetter, location, prototype);
124-
model = bakedTopLevelModels.remove(location);
125-
if(model == null) {
126-
ModernFix.LOGGER.error("Failed to load model " + location);
119+
if(prototype == missingModel) {
127120
model = bakedMissingModel;
121+
} else {
122+
prototype.resolveParents(this::getModel);
123+
if(DEBUG_MODEL_LOADS) {
124+
ModernFix.LOGGER.info("Baking model {}", location);
125+
}
126+
this.method_61072(this.textureGetter, location, prototype);
127+
model = bakedTopLevelModels.remove(location);
128+
if(model == null) {
129+
ModernFix.LOGGER.error("Failed to load model " + location);
130+
model = bakedMissingModel;
131+
}
128132
}
129133
}
130134
} finally {

0 commit comments

Comments
 (0)