Skip to content

Commit b3f00a0

Browse files
committed
Merge 1.19.4 into 1.20
2 parents 827d092 + 8cc5785 commit b3f00a0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
6666
@Shadow
6767
public abstract void loadTopLevel(ModelResourceLocation modelResourceLocation);
6868

69+
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);
70+
6971
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
7072

7173
private Cache<ResourceLocation, UnbakedModel> loadedModels;
@@ -255,7 +257,7 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
255257
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
256258
try {
257259
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
258-
result.getMaterials(this::getModel, new HashSet<>());
260+
result.resolveParents(this::getModel);
259261
} catch(RuntimeException ignored) {}
260262
// We are done with loading, so clear this cache to allow GC of any unneeded models
261263
if(mfix$nestedLoads == 0)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
6363

6464
@Shadow @Final @Mutable private BlockColors blockColors;
6565
@Shadow @Final private static Logger LOGGER;
66+
67+
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);
68+
6669
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
6770

6871
private Cache<ResourceLocation, UnbakedModel> loadedModels;
@@ -236,7 +239,7 @@ public void getOrLoadModelDynamic(ResourceLocation modelLocation, CallbackInfoRe
236239
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
237240
try {
238241
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
239-
result.getMaterials(this::getModel, new HashSet<>());
242+
result.resolveParents(this::getModel);
240243
} catch(RuntimeException ignored) {}
241244
// We are done with loading, so clear this cache to allow GC of any unneeded models
242245
if(mfix$nestedLoads == 0)

0 commit comments

Comments
 (0)