Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOB related crash when certain elements are removed from pause screen #19

Closed
CodeF53 opened this issue Mar 30, 2021 · 2 comments
Closed

Comments

@CodeF53
Copy link

CodeF53 commented Mar 30, 2021

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)
@jackassmc
Copy link
Contributor

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.

TomB-134 added a commit that referenced this issue May 31, 2021
…creen code into the game pause screen code
@TomB-134
Copy link
Owner

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.

TomB-134 added a commit that referenced this issue May 31, 2021
Hypothetically fixed #19 and duplicates, implemented umollu's title s…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants