I found 3 main bugs that may be causing the GUI to crash:
Bugs found
1. ClickGuiScreen uses Singleton — and never resets when closed (most likely cause of crash)
In GuiModule.java:
javapublic void onEnabled() {
setEnabled(false);
ClickGuiScreen gui = ClickGuiScreen.getInstance(); // reuses old instance
mc.displayGuiScreen(gui);
}
And in ClickGuiScreen.java:
javapublic static ClickGuiScreen getInstance() {
if (instance == null) {
instance = new ClickGuiScreen();
}
return instance;
} The problem: The getInstance() creates the screen once and reuses it every time. But in the constructor, the modules are added to the lists (combatModules, etc.). If the moduleManager has not yet been fully initialized the first time the GUI is created, some modules arrive as null. This is filtered, but the state gets stuck in the old instance — and initGui() resets scroll but doesn't reinitialize the frames.
Fix: Call resetInstance() when the GUI closes, or rebuild the frames in initGui().
2. Frame.mouseClicked has a wrong condition that blocks clicks on the modules
javaif (expanded) {
if (currentHeight <= height) return false; // ← BUG HERE
...
} If the expansion animation hasn't finished yet (currentHeight is still animating), no clicks on the modules are registered, which can cause strange behavior or loops.
3. ShadowShader uses GLSL and may crash on older or unsupported GPUs
javaprivate static final ShaderUtil shadowShader = new ShaderUtil(SHADOW_SHADER_SOURCE);
The shader is initialized as a static field at class time. If the GPU doesn't support #version 120 with the uniforms used, the game crashes when loading the class, even before the GUI appears.
Quick fix: Disable shadows in ClickGUI (there's a shadow option in the ClickGUI module). If the crash disappears with shadows disabled, the problem is this shader.
I found 3 main bugs that may be causing the GUI to crash:
Bugs found
1. ClickGuiScreen uses Singleton — and never resets when closed (most likely cause of crash)
In GuiModule.java:
javapublic void onEnabled() {
setEnabled(false);
ClickGuiScreen gui = ClickGuiScreen.getInstance(); // reuses old instance
mc.displayGuiScreen(gui);
}
And in ClickGuiScreen.java:
javapublic static ClickGuiScreen getInstance() {
if (instance == null) {
instance = new ClickGuiScreen();
}
return instance;
} The problem: The getInstance() creates the screen once and reuses it every time. But in the constructor, the modules are added to the lists (combatModules, etc.). If the moduleManager has not yet been fully initialized the first time the GUI is created, some modules arrive as null. This is filtered, but the state gets stuck in the old instance — and initGui() resets scroll but doesn't reinitialize the frames.
Fix: Call resetInstance() when the GUI closes, or rebuild the frames in initGui().
2. Frame.mouseClicked has a wrong condition that blocks clicks on the modules
javaif (expanded) {
if (currentHeight <= height) return false; // ← BUG HERE
...
} If the expansion animation hasn't finished yet (currentHeight is still animating), no clicks on the modules are registered, which can cause strange behavior or loops.
3. ShadowShader uses GLSL and may crash on older or unsupported GPUs
javaprivate static final ShaderUtil shadowShader = new ShaderUtil(SHADOW_SHADER_SOURCE);
The shader is initialized as a static field at class time. If the GPU doesn't support #version 120 with the uniforms used, the game crashes when loading the class, even before the GUI appears.
Quick fix: Disable shadows in ClickGUI (there's a shadow option in the ClickGUI module). If the crash disappears with shadows disabled, the problem is this shader.