BuildCraft|Factory

BuildCraft|Factory

7M Downloads

Game crashes when rending is halted but mouse is moved over an item

twothe opened this issue ยท 5 comments

commented

BuildCraft version: 7.99.23
Forge version: 14.23.5.2824
Singleplayer or multiplayer: SP
Additional information:

Game crashes mouse is moved over a ghost item without tooltip:

Description: Rendering screen

java.lang.NullPointerException: Rendering screen
	at buildcraft.builders.item.ItemSnapshot.getHeader(ItemSnapshot.java:56)
	at buildcraft.builders.BCBuildersEventDist.onRenderTooltipPostText(BCBuildersEventDist.java:97)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_502_BCBuildersEventDist_onRenderTooltipPostText_PostText.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
	at net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(GuiUtils.java:409)
	at elec332.core.inventory.tooltip.ToolTip.renderTooltip(ToolTip.java:55)
	at elec332.core.inventory.window.Window.drawScreenPost(Window.java:419)
	at elec332.craftingtableiv.inventory.WindowCraftingTableIV.drawScreenPost(WindowCraftingTableIV.java:414)
	at elec332.core.inventory.window.WindowGui.func_73863_a(WindowGui.java:98)
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:396)
	at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1124)
	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1119)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)
	at net.minecraft.client.main.Main.main(SourceFile:123)
	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:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

commented

what do you mean with rendering is halted?

commented

I have a mod that when opening a specific GUI will freeze the game for a few seconds. However I later found out that this was not the cause, it is a simple nullpointer, because the items displayed are ghost items without a real ItemStack. Adding a null-check fixes the problem immediately.

commented

this is 1.12.2, passing null as itemstack is invalid, itemstack.EMPTY should be used instead

commented

True. That leaves two options: making sure that every other mod out there is programmed without bugs, or adding a null-check.

Adding a null check takes less time than this discussion already did. ;)

commented

It looks like this is already being tracked on ElecCore's side: Elecs-Mods/ElecCore#144