NullPointerException when undoing thaumcraft prereqs added before moving
Xavion3 opened this issue ยท 4 comments
The error that appears in the log
This consistently occurs whenever scripts would be reloaded, naturally causing issues as it would be preferable for people to be able to leave and rejoin a server or world without restarting the client as gregtech makes that painfully slow. The full scripts currently used are the three scripts starting with thaumcraft here, unfortunately that amounts to over three thousand lines of scripts between the files so sorry if it makes things difficult.
I'll try to get a minimal reproduction within a few days, maybe it's related to how we're basically creating entire new branches of research and modifying standard ones to fit with them so somewhere in there it's accidentally deleting a research early or something while undoing? We've done basically everything it's possible to do with modifying research so it's mostly guesswork on that guess.
Since the branch Xavion linked to was deleted, here are new links:
https://github.com/JasonMcRay/InfiTech-1.7/blob/master/scripts/thaumcraft.zs
https://github.com/JasonMcRay/InfiTech-1.7/blob/master/scripts/thaumcraftclusters.zs
https://github.com/JasonMcRay/InfiTech-1.7/blob/master/scripts/thaumcraftenchantments.zs
Sorry for the delays, kinda forgot for a while but I tracked this down to a seemingly simple cause. It's triggered by moving the research after adding a prereq, move then add prereq works fine but add prereq then move throws an NPE when the scripts try to reload. This was the test script I had, moving the move research line down three to below addPrereq triggers the error for me, this one requires modifying a witching gadgets research.
import mods.thaumcraft.Crucible;
import mods.thaumcraft.Research;
Research.moveResearch("PURECINNABAR", "ALCHEMY", -2, 7);
Research.orphanResearch("PURECINNABAR");
Research.clearPrereqs("PURECINNABAR");
Research.addPrereq("PURECINNABAR", "PUREIRON", false);
Research.clearPages("PURECINNABAR");
Research.addPage("PURECINNABAR", "kirara.research_page.PURECINNABAR.1");
game.setLocalization("en_US", "kirara.research_page.PURECINNABAR.1", "Native clusters are rare concentrations of metal in its purest form. You have discovered a way to purify and concentrate normal cinnabar ore into a native cinnabar cluster.<BR>When smelted these clusters provide twice the normal amount of quicksilver, and when centrifuged provide nearly four quicksilver.");
Research.addCruciblePage("PURECINNABAR", <Thaumcraft:ItemNugget:21>);