Guard against early parent resolution failing

This commit is contained in:
embeddedt 2023-07-09 20:36:57 -04:00
parent 49b31c347b
commit dfdbf8544a
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 8 additions and 4 deletions

View File

@ -401,8 +401,10 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
// the model immediately
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
result.getMaterials(this::getModel, new HashSet<>());
try {
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
result.getMaterials(this::getModel, new HashSet<>());
} catch(RuntimeException ignored) {}
// We are done with loading, so clear this cache to allow GC of any unneeded models
if(mfix$nestedLoads == 0)
smallLoadingCache.clear();

View File

@ -286,8 +286,10 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
// As in pathological cases (e.g. Pedestals on 1.19) unbakedCache can lose
// the model immediately
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
result.getMaterials(this::getModel, new HashSet<>());
try {
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
result.getMaterials(this::getModel, new HashSet<>());
} catch(RuntimeException ignored) {}
// We are done with loading, so clear this cache to allow GC of any unneeded models
if(mfix$nestedLoads == 0)
smallLoadingCache.clear();