Skip to content

Commit ef47883

Browse files
committed
Merge 1.16 into 1.18
2 parents e248e29 + dfdbf85 commit ef47883

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,10 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
408408
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
409409
// the model immediately
410410
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
411-
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
412-
result.getMaterials(this::getModel, new HashSet<>());
411+
try {
412+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
413+
result.getMaterials(this::getModel, new HashSet<>());
414+
} catch(RuntimeException ignored) {}
413415
// We are done with loading, so clear this cache to allow GC of any unneeded models
414416
if(mfix$nestedLoads == 0)
415417
smallLoadingCache.clear();

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
286286
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
287287
// the model immediately
288288
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
289-
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
290-
result.getMaterials(this::getModel, new HashSet<>());
289+
try {
290+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
291+
result.getMaterials(this::getModel, new HashSet<>());
292+
} catch(RuntimeException ignored) {}
291293
// We are done with loading, so clear this cache to allow GC of any unneeded models
292294
if(mfix$nestedLoads == 0)
293295
smallLoadingCache.clear();

0 commit comments

Comments
 (0)