OOB related crash when certain elements are removed from pause screen
CodeF53 opened this issue ยท 2 comments
With all "remove" options in the pause screen enabled, opening the pause screen causes an OOB error.
Description: mouseClicked event handler
java.lang.IndexOutOfBoundsException: Index 8 out of bounds for length 8
at Not Enough Crashes deobfuscated stack trace.(1.16.5+build.6)
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:427)
at net.minecraft.client.gui.screen.GameMenuScreen.handler$cmb000$initWidgets(GameMenuScreen:1031)
at net.minecraft.client.gui.screen.GameMenuScreen.initWidgets(GameMenuScreen:92)
at net.minecraft.client.gui.screen.GameMenuScreen.init(GameMenuScreen:27)
at net.minecraft.client.gui.screen.Screen.init(Screen:325)
at net.minecraft.client.MinecraftClient.openScreen(MinecraftClient:922)
at com.terraformersmc.modmenu.gui.ModsScreen.lambda$init$12(ModsScreen.java:250)
at net.minecraft.client.gui.widget.ButtonWidget.onPress(ButtonWidget:33)
at net.minecraft.client.gui.widget.AbstractPressableButtonWidget.onClick(AbstractPressableButtonWidget:16)
at net.minecraft.client.gui.widget.AbstractButtonWidget.mouseClicked(AbstractButtonWidget:149)
at net.minecraft.client.gui.ParentElement.mouseClicked(ParentElement:27)
at net.minecraft.client.Mouse.method_1611(Mouse:92)
at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen:435)
at net.minecraft.client.Mouse.onMouseButton(Mouse:92)
at net.minecraft.client.Mouse.method_22686(Mouse:162)
at net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor:94)
at net.minecraft.client.Mouse.method_22684(Mouse:162)
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
at org.lwjgl.system.JNI.invokeV(Native Method)
at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3174)
at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem:127)
at net.minecraft.client.MinecraftClient.render(MinecraftClient:1071)
at net.minecraft.client.MinecraftClient.run(MinecraftClient:681)
at net.minecraft.client.MinecraftClient.handler$zhm000$afterCrashHandled(MinecraftClient:4404)
at net.minecraft.client.MinecraftClient.run(MinecraftClient:704)
at net.minecraft.client.MinecraftClient.handler$zhm000$afterCrashHandled(MinecraftClient:4404)
at net.minecraft.client.MinecraftClient.run(MinecraftClient:699)
at net.minecraft.client.main.Main.main(Main:215)
The problem is that MinimalMenu runs before ModMenu and assumes that the ModMenu button already exists. When removing the "Open to LAN" button the ninth button is accessed, but only eight buttons exist, causing this crash.
That should be (fingers crossed because I couldn't reproduce) fixed now, @jackassmc Thanks a lot for pointing out the issues in the code across the multiple issue reports. Made this clean up much easier.