From 638af63f4d6241697943772f38e678da3b66fba8 Mon Sep 17 00:00:00 2001 From: RainWarrior Date: Mon, 23 Feb 2015 16:02:10 +0300 Subject: [PATCH] Hopefully fix NPE during baking of empty vanilla item models --- src/main/java/net/minecraftforge/client/model/ModelLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoader.java b/src/main/java/net/minecraftforge/client/model/ModelLoader.java index d4b896ce1..bdcad5454 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoader.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoader.java @@ -262,6 +262,7 @@ public class ModelLoader extends ModelBakery } ModelBlock model = this.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); return new IFlexibleBakedModel.Wrapper(bakeModel(model, state.apply(this), state instanceof UVLock), Attributes.DEFAULT_BAKED_FORMAT); }