Skyblocker
Skyblocker copied to clipboard
Chat rules IndexOutOfBounds
Minecraft Version
1.20.6
Skyblocker Version
Latest, built from 6886f2d
Reproduction Steps
This was my first time using the chat rules, so I have the 2 default rules.
- Enable the mining ability chat rule
- Try to add a new chat right afterwards
- Boom
Crash Report file and latest.log
---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.
Time: 2024-05-18 05:31:43
Description: mouseClicked event handler
java.lang.IndexOutOfBoundsException: Index: 3, Size: 2
at [email protected]/java.util.ArrayList.rangeCheckForAdd(ArrayList.java:838)
at [email protected]/java.util.ArrayList.add(ArrayList.java:510)
at de.hysky.skyblocker.skyblock.chat.ChatRulesConfigListWidget.addRuleAfterSelected(ChatRulesConfigListWidget.java:50)
at de.hysky.skyblocker.skyblock.chat.ChatRulesConfigScreen.lambda$init$1(ChatRulesConfigScreen.java:40)
at MC//net.minecraft.client.gui.widget.ButtonWidget.onPress(ButtonWidget.java:96)
at MC//net.minecraft.client.gui.widget.PressableWidget.onClick(PressableWidget.java:48)
at MC//net.minecraft.client.gui.widget.ClickableWidget.mouseClicked(ClickableWidget.java:141)
at MC//net.minecraft.client.gui.ParentElement.mouseClicked(ParentElement.java:38)
at MC//net.minecraft.client.Mouse.method_1611(Mouse.java:101)
at MC//net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:467)
at MC//net.minecraft.client.Mouse.onMouseButton(Mouse.java:101)
at MC//net.minecraft.client.Mouse.method_22686(Mouse.java:186)
at MC//net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor.java:108)
at MC//net.minecraft.client.Mouse.method_22684(Mouse.java:186)
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43)
at org.lwjgl.system.JNI.invokeV(Native Method)
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3438)
at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:200)
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:218)
at MC//net.minecraft.client.util.Window.swapBuffers(Window.java:287)
at MC//net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1342)
at MC//net.minecraft.client.MinecraftClient.run(MinecraftClient.java:888)
at net.minecraft.client.main.Main.main(Main.java:265)
at app//net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
at app//net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at app//net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at app//org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100)
at app//org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)
at app//org.prismlauncher.EntryPoint.main(EntryPoint.java:70)
Additional context
I haven't read the code as I was too lazy but based on what I understand from the call stack it seems to try and add the new rule after the selected element, but fails to do so when the selected element is the enabled/disabled button. Anyway, this is just a guess and might be wrong.