Skip to content

Commit 49b31c3

Browse files
committed
Resolve parents in getModel rather than at bake time
Fixes EBE chests
1 parent f040f66 commit 49b31c3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
401401
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
402402
// the model immediately
403403
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
404+
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
405+
result.getMaterials(this::getModel, new HashSet<>());
404406
// We are done with loading, so clear this cache to allow GC of any unneeded models
405407
if(mfix$nestedLoads == 0)
406408
smallLoadingCache.clear();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ 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<>());
289291
// We are done with loading, so clear this cache to allow GC of any unneeded models
290292
if(mfix$nestedLoads == 0)
291293
smallLoadingCache.clear();

0 commit comments

Comments
 (0)