Merge 1.19.4 into 1.20

This commit is contained in:
embeddedt 2023-07-09 20:41:08 -04:00
commit b3f00a0681
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 7 additions and 2 deletions

View File

@ -66,6 +66,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
@Shadow
public abstract void loadTopLevel(ModelResourceLocation modelResourceLocation);
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
private Cache<ResourceLocation, UnbakedModel> loadedModels;
@ -255,7 +257,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
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<>());
result.resolveParents(this::getModel);
} catch(RuntimeException ignored) {}
// We are done with loading, so clear this cache to allow GC of any unneeded models
if(mfix$nestedLoads == 0)

View File

@ -63,6 +63,9 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
@Shadow @Final @Mutable private BlockColors blockColors;
@Shadow @Final private static Logger LOGGER;
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
private Cache<ResourceLocation, UnbakedModel> loadedModels;
@ -236,7 +239,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
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<>());
result.resolveParents(this::getModel);
} catch(RuntimeException ignored) {}
// We are done with loading, so clear this cache to allow GC of any unneeded models
if(mfix$nestedLoads == 0)