Hopefully fix NPE during baking of empty vanilla item models

This commit is contained in:
RainWarrior 2015-02-23 16:02:10 +03:00
parent 7c03542d94
commit 638af63f4d

View file

@ -262,6 +262,7 @@ public class ModelLoader extends ModelBakery
} }
ModelBlock model = this.model; ModelBlock model = this.model;
if(hasItemModel(model)) model = makeItemModel(model); if(hasItemModel(model)) model = makeItemModel(model);
if(model == null) return getMissingModel().bake(state, format, bakedTextureGetter);
if(isCustomRenderer(model)) return new IFlexibleBakedModel.Wrapper(new BuiltInModel(new ItemCameraTransforms(model.getThirdPersonTransform(), model.getFirstPersonTransform(), model.getHeadTransform(), model.getInGuiTransform())), Attributes.DEFAULT_BAKED_FORMAT); if(isCustomRenderer(model)) return new IFlexibleBakedModel.Wrapper(new BuiltInModel(new ItemCameraTransforms(model.getThirdPersonTransform(), model.getFirstPersonTransform(), model.getHeadTransform(), model.getInGuiTransform())), Attributes.DEFAULT_BAKED_FORMAT);
return new IFlexibleBakedModel.Wrapper(bakeModel(model, state.apply(this), state instanceof UVLock), Attributes.DEFAULT_BAKED_FORMAT); return new IFlexibleBakedModel.Wrapper(bakeModel(model, state.apply(this), state instanceof UVLock), Attributes.DEFAULT_BAKED_FORMAT);
} }