RFTools

RFTools

74M Downloads

Game Crash on GUI open

Smtgr14 opened this issue ยท 8 comments

commented

Issue:
The game crashed whilst rendering screen
Error: java.lang.NullPointerException: Rendering screen

Steps to Reproduce

  1. Load game
  2. Load a New or Existing World
  3. Place any RF Tools block w/ a GUI
  4. Right click the block
  5. Game will crash, server remains unaffected.

Error Reported & Crash Report

The game crashed whilst rendering screen
Error: java.lang.NullPointerException: Rendering screen

crash-2017-07-03_09.25.15-client.txt

commented

@mezz Another one...

We're aware of this problem but atm it is eluding us

commented

@Smtgr14 what modpack is this?

commented

I'm releasing a version of McJtyLib that protects against this and will log the error so that we can still try to track down the real problem. Probably a mod that does something wrong in a gui event or something

commented

Probably a mod that does something wrong in a gui event or something

Technically I wouldn't say it's "wrong", as the InitGuiEvent.Pre event is designed to be cancelled. Perhaps we need some clarification as to what Forge expects to happen after that event is cancelled? Essentially functions shouldn't be blindly expecting something set in initGui to be non-null I guess?

For reference:

/**
 * This event fires just after initializing {@link GuiScreen#mc}, {@link GuiScreen#fontRendererObj},
 * {@link GuiScreen#width}, and {@link GuiScreen#height}.<br/><br/>
 * 
 * If canceled the following lines are skipped in {@link GuiScreen#setWorldAndResolution(Minecraft, int, int)}:<br/>
 * {@code this.buttonList.clear();}<br/>
 * {@code this.initGui();}<br/>
 */

It is indeed odd though that someone would cancel this event and not the open gui one. EDIT: I guess they're not checking it's their GUI being inited

commented

I've started removing mods and found it's forestry's beta I left installed by mistake.
The updated McJtyLib does fix the issue.

commented

Heh, I was also getting some NPEs in RS for fields that are initialized in initGui. Why in the world would that event be cancel-able?! initGui is the place where you initialize things...

commented

Have you found out what mod is doing the canceling?

commented

Nope.. I just added null guards.