Botania

Botania

133M Downloads

Crash when looking through Lexicon

the-vindex opened this issue ยท 5 comments

commented

https://gist.githubusercontent.com/the-vindex/f7217b3588dbe792a397/raw/1cf33e416ec236755853fd8e16765a9d4e9585bf/fml.log

It's long log, so look for at the end
java.lang.NullPointerException: Updating screen events
at net.minecraft.item.ItemStack.func_82833_r(ItemStack.java:427)
at vazkii.botania.client.gui.lexicon.GuiLexiconIndex.matchesSearch(GuiLexiconIndex.java:145)

commented

It looks like the null-pointer is occurring inside stack.getDisplayName() in client/gui/lexicon/GuiLexiconIndex.java in this loop:

for(ItemStack stack : e.getDisplayedRecipes()) {
    String stackName = stack.getDisplayName().toLowerCase().trim();
    if(stackName.contains(search))
        return true;
}

I'm assuming func_82833_r is getDisplayName here, which means the error lies somewhere in obtaining an item or so forth. The easiest way to fix the crash, at least, to allow for further debugging is to use hasDisplayName() before getting the display name and replacing it with "ERROR" or similar if a display name does not exist.

commented

Thought I'd mention an observation on this crash, it happens to me when holding the Lexicon and passing the player's crosshairs pass Buildcraft pipes

commented

oh I fixed this in 1.8 - it's because the lexicon uses the non player sensitive version of getPickBlock which passes null to the player sensitive version which BC doesn't handle well.

Probably should be reported to BC to be honest.

commented

Why is it only holding the Lexicon that it happens? just curious

commented

To get the itemstack form of the block to look up the wiki link for the shift right click