Closed banqq closed 3 years ago
could you hand over the stack trace?
Can you send me your module class too? I had a problem caused by a small thing in it.
could you hand over the stack trace?
---- Minecraft Crash Report ---- // Why did you do that?
Time: 1/25/21 7:04 PM Description: Rendering screen
java.lang.NullPointerException: Rendering screen at com.lukflug.panelstudio.theme.SettingsColorScheme.getActiveColor(SettingsColorScheme.java:58) at com.lukflug.panelstudio.theme.GameSenseTheme$ComponentRenderer.getMainColor(GameSenseTheme.java:109) at com.lukflug.panelstudio.theme.GameSenseTheme$ComponentRenderer.renderRect(GameSenseTheme.java:52) at com.lukflug.panelstudio.theme.RendererBase.renderTitle(RendererBase.java:100) at com.lukflug.panelstudio.theme.RendererBase.renderTitle(RendererBase.java:108) at com.lukflug.panelstudio.CollapsibleContainer.render(CollapsibleContainer.java:75) at com.lukflug.panelstudio.ClickGUI.render(ClickGUI.java:98) at com.lukflug.panelstudio.mc12.MinecraftGUI.renderGUI(MinecraftGUI.java:53) at com.lukflug.panelstudio.mc12.MinecraftGUI.drawScreen(MinecraftGUI.java:66) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:396) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1124) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1119) at net.minecraft.client.Minecraft.run(Minecraft.java:398) at net.minecraft.client.main.Main.main(Main.java:118) 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) 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.minecraftforge.legacydev.Main.start(Main.java:86) at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29)
-- Head -- Thread: Client thread Stacktrace: at com.lukflug.panelstudio.theme.SettingsColorScheme.getActiveColor(SettingsColorScheme.java:58) at com.lukflug.panelstudio.theme.GameSenseTheme$ComponentRenderer.getMainColor(GameSenseTheme.java:109) at com.lukflug.panelstudio.theme.GameSenseTheme$ComponentRenderer.renderRect(GameSenseTheme.java:52) at com.lukflug.panelstudio.theme.RendererBase.renderTitle(RendererBase.java:100) at com.lukflug.panelstudio.theme.RendererBase.renderTitle(RendererBase.java:108) at com.lukflug.panelstudio.CollapsibleContainer.render(CollapsibleContainer.java:75) at com.lukflug.panelstudio.ClickGUI.render(ClickGUI.java:98) at com.lukflug.panelstudio.mc12.MinecraftGUI.renderGUI(MinecraftGUI.java:53) at com.lukflug.panelstudio.mc12.MinecraftGUI.drawScreen(MinecraftGUI.java:66) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:396)
Settings.animationSpeed might be null?
It seems you initialized PanelStudio before initializing the settings, thus the setting objects are still null and thus you pass null to the constructor of SettingColorScheme
, causing the crash.
It seems you initialized PanelStudio before initializing the settings, thus the setting objects are still null and thus you pass null to the constructor of
SettingColorScheme
, causing the crash.
again NullPointerException only in another method. I do not know what to do(
guiInterface = new GUIInterface(true) {
@Override protected String getResourcePrefix() { return "darkclient:gui/"; }
@Override
public void drawString(Point pos, String s, Color c) {
end();
fontRenderer.drawString(s, pos.x, pos.y, c.getRGB());
begin();
}
@Override
public int getFontWidth(String s) {return fontRenderer.getStringWidth(s+14);}
@Override
public int getFontHeight() {return fontRenderer.FONT_HEIGHT+4;}
};
Stacktrace:
java.lang.NullPointerException: Rendering screen at ru.s1ash.darkclient.gui.clickgui.Gui$2.drawString(Gui.java:42) at com.lukflug.panelstudio.theme.GameSenseTheme$ComponentRenderer.renderRect(GameSenseTheme.java:65) at com.lukflug.panelstudio.theme.RendererBase.renderTitle(RendererBase.java:100) at com.lukflug.panelstudio.theme.RendererBase.renderTitle(RendererBase.java:108) at com.lukflug.panelstudio.CollapsibleContainer.render(CollapsibleContainer.java:75) at com.lukflug.panelstudio.ClickGUI.render(ClickGUI.java:98) at com.lukflug.panelstudio.mc12.MinecraftGUI.renderGUI(MinecraftGUI.java:53) at com.lukflug.panelstudio.mc12.MinecraftGUI.drawScreen(MinecraftGUI.java:66) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:396) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1124) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1119) at net.minecraft.client.Minecraft.run(Minecraft.java:398) at net.minecraft.client.main.Main.main(Main.java:118) 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) 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.minecraftforge.legacydev.Main.start(Main.java:86) at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29)
**fontRender = Minecraft.getMinecraft().fontRenderer
you didn't override drawString, you need to override it and put Minecraft.getMinecraft().fontRenderer.drawString
wait you did my bad lol
instead of fontRenderer have Minecraft.getMinecraft().fontRenderer so it refreshes when the fontRenderer does if it does
it works! thank you very much
the console will tell you that the error is in this block of code:
DraggableContainer categoryPanel = new DraggableContainer( "Exploits", null, theme.getPanelRenderer(), new SimpleToggleable(false), new SettingsAnimation(Settings.animationSpeed), null, new Point(10, 10), 100 ); gui.addComponent(categoryPanel);
all the necessary components were inherited from the library classes, there should be no errors. but on startup I get a gray screen with 5 small squares in the middle lined up in a row. in a second it disappears and i get a crash