Set the missing model early if needed

This commit is contained in:
embeddedt 2023-05-08 14:15:22 -04:00
parent c420c63ab1
commit 85025b77fb
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -296,6 +296,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
ModernFix.LOGGER.info("{} unbaked models, {} baked models loaded permanently", this.unbakedCache.size(), this.bakedCache.size());
this.unbakedCache = new LayeredForwardingMap<>(new Map[] { this.unbakedCache, mutableBackingMap });
this.bakedTopLevelModels = new DynamicBakedModelProvider((ModelBakery)(Object)this, bakedCache);
if(this.bakedMissingModel != null)
((DynamicBakedModelProvider)this.bakedTopLevelModels).setMissingModel(this.bakedMissingModel);
// ensure missing model is a permanent override
this.bakedTopLevelModels.put(MISSING_MODEL_LOCATION, this.bake(MISSING_MODEL_LOCATION, BlockModelRotation.X0_Y0));