Chicken-Bones / NotEnoughItems

MIT License
130 stars 136 forks source link

Crash when trying to render ItemStack for Blocks.fire #298

Open Ordinastie opened 9 years ago

Ordinastie commented 9 years ago

When rendering items, the fallback in case an exception occurs is to draw an ItemStack of Blocks.fire. Except there is no item for Blocks.fire so the rendering NPEs.

https://github.com/Chicken-Bones/NotEnoughItems/blob/master/src/codechicken/nei/guihook/GuiContainerManager.java#L210

Stacktrace : java.lang.NullPointerException: Rendering screen at net.minecraft.item.ItemStack.func_77960_j(ItemStack.java:235) at net.minecraft.client.renderer.ItemModelMesher.func_178084_b(ItemModelMesher.java:70) at net.minecraft.client.renderer.ItemModelMesher.func_178089_a(ItemModelMesher.java:43) at net.minecraft.client.renderer.entity.RenderItem.func_175042_a(RenderItem.java:362) at codechicken.nei.guihook.GuiContainerManager.drawItem(GuiContainerManager.java:210) at codechicken.nei.guihook.GuiContainerManager.drawItem(GuiContainerManager.java:178) at codechicken.nei.ItemPanel.draw(ItemPanel.java:129) at codechicken.nei.LayoutManager.renderObjects(LayoutManager.java:197) at codechicken.nei.guihook.GuiContainerManager.renderObjects(GuiContainerManager.java:389) at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:118) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:459) at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1081) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1056) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:345) at net.minecraft.client.main.Main.main(SourceFile:120) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)