Improve compatibility with mods that inject into ModelBaker.bake

Fixes #646
This commit is contained in:
embeddedt 2026-04-22 19:27:07 -04:00
parent 26bd7116a1
commit b765bcb51f
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -374,7 +374,12 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
ModelBakery self = (ModelBakery) (Object) this;
ModelBaker theBaker = self.new ModelBakerImpl(textureGetter, modelLocation);
((IExtendedModelBaker)theBaker).throwOnMissingModel(true);
synchronized(this) { m = theBaker.bake(modelLocation, state, theBaker.getModelTextureGetter()); }
synchronized(this) {
// We intentionally use the 2-arg overload for better mixin compatibility, because we use the baker's default
// texture getter anyway.
//noinspection deprecation
m = theBaker.bake(modelLocation, state);
}
if(m != null)
loadedBakedModels.put(key, m);
return m;