Sophisticated Backpacks

Sophisticated Backpacks

89M Downloads

Game crashes when i SHIFT + LMB on certain backpack slots

Xernary opened this issue ยท 2 comments

commented

Description
When pressing SHIFT + LMB on a backpack slot containing any item, the game crashes. It only happens after a certain slot, the ones before work fine.

Error
The game crashed whilst mouseclicked event handler
Error: java.lang.IndexOutOfBoundsException: Index 46 out of bounds for length 46

To Reproduce
Steps to reproduce the behavior:

  1. Open backpack
  2. Click SHIFT + LMB on one of the last slots
  3. Game crashes

Versions
Mod version 1.20.1-3.20.6.1064. Forge version 47.3.5

I believe the issue is that when opening the backpack sometimes the backpack's "inventory" does not get initialized correctly, so the List representing its slots has either size 0 (causing an out of bound error for each slot) or a random size that is smaller than the actual number of slots. Checking how and when those Lists get initialized might help.

Full error log
Description: mouseClicked event handler

java.lang.IndexOutOfBoundsException: Index 46 out of bounds for length 46
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:266) ~[?:?] {}
at java.util.Objects.checkIndex(Objects.java:361) ~[?:?] {re:mixin}
at java.util.ArrayList.get(ArrayList.java:427) ~[?:?] {re:mixin}
at net.minecraft.core.NonNullList.get(NonNullList.java:47) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,re:classloading}
at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handler$eoa004$onInit(ServerboundContainerClickPacket.java:558) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,re:classloading,pl:mixin:A}
at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.(ServerboundContainerClickPacket.java:30) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,re:classloading,pl:mixin:A}
at net.p3pp3rf1y.sophisticatedcore.client.gui.StorageScreenBase.handleInventoryMouseClick(StorageScreenBase.java:813) ~[sophisticatedcore-1.20.1-0.6.25.632.jar%23398!/:1.20.1-0.6.25.632] {re:classloading}
at net.p3pp3rf1y.sophisticatedcore.client.gui.StorageScreenBase.m_6597_(StorageScreenBase.java:760) ~[sophisticatedcore-1.20.1-0.6.25.632.jar%23398!/:1.20.1-0.6.25.632] {re:classloading}
at net.minecraft.client.gui.screens.inventory.AbstractContainerScreen.m_6375_(AbstractContainerScreen.java:329) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:calio:calio_ContainerScreenAccessor,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:calio:calio_ContainerScreenAccessor,pl:mixin:APP:puzzlesapi.common.mixins.json:iteminteractions.client.AbstractContainerScreenMixin,pl:mixin:APP:puzzlesapi.common.mixins.json:iteminteractions.client.accessor.AbstractContainerScreenAccessor,pl:mixin:APP:mousetweaks.mixins.json:AbstractContainerScreenAccessor,pl:mixin:APP:quark.mixins.json:client.ContainerScreenMixin,pl:mixin:APP:smoothswapping-common.mixins.json:HandledScreenMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.p3pp3rf1y.sophisticatedcore.client.gui.StorageScreenBase.m_6375_(StorageScreenBase.java:828) ~[sophisticatedcore-1.20.1-0.6.25.632.jar%23398!/:1.20.1-0.6.25.632] {re:classloading}
at net.minecraft.client.MouseHandler.m_168084_(MouseHandler.java:92) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:smallships-common.mixins.json:zooming.client.MouseHandlerMixin,pl:mixin:APP:puzzlesapi.common.mixins.json:slotcycling.client.accessor.MouseHandlerAccessor,pl:mixin:APP:supplementaries-common.mixins.json:MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screens.Screen.m_96579_(Screen.java:437) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:quark.mixins.json:client.ScreenMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.MouseHandler.m_91530_(MouseHandler.java:89) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:smallships-common.mixins.json:zooming.client.MouseHandlerMixin,pl:mixin:APP:puzzlesapi.common.mixins.json:slotcycling.client.accessor.MouseHandlerAccessor,pl:mixin:APP:supplementaries-common.mixins.json:MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.MouseHandler.m_168091_(MouseHandler.java:189) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:smallships-common.mixins.json:zooming.client.MouseHandlerMixin,pl:mixin:APP:puzzlesapi.common.mixins.json:slotcycling.client.accessor.MouseHandlerAccessor,pl:mixin:APP:supplementaries-common.mixins.json:MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:102) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
at net.minecraft.client.MouseHandler.m_91565_(MouseHandler.java:188) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:smallships-common.mixins.json:zooming.client.MouseHandlerMixin,pl:mixin:APP:puzzlesapi.common.mixins.json:slotcycling.client.accessor.MouseHandlerAccessor,pl:mixin:APP:supplementaries-common.mixins.json:MouseHandlerMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.1.jar%23141!/:build 7] {}
at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.1.jar%23153!/:build 7] {}
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403) ~[lwjgl-glfw-3.3.1.jar%23141!/:build 7] {re:mixin}
at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:201) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinGlStateManager,pl:mixin:APP:mixins.oculus.json:MixinRenderSystem,pl:mixin:APP:mixins.oculus.json:statelisteners.MixinRenderSystem,pl:mixin:APP:flywheel.mixins.json:RenderTexturesMixin,pl:mixin:APP:embeddium.mixins.json:workarounds.event_loop.RenderSystemMixin,pl:mixin:A}
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:219) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:mixins.oculus.json:MixinGlStateManager,pl:mixin:APP:mixins.oculus.json:MixinRenderSystem,pl:mixin:APP:mixins.oculus.json:statelisteners.MixinRenderSystem,pl:mixin:APP:flywheel.mixins.json:RenderTexturesMixin,pl:mixin:APP:embeddium.mixins.json:workarounds.event_loop.RenderSystemMixin,pl:mixin:A}
at com.mojang.blaze3d.platform.Window.m_85435_(Window.java:274) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:immediatelyfast-common.mixins.json:core.MixinWindow,pl:mixin:APP:sodium-extra.mixins.json:adaptive_sync.MixinWindow,pl:mixin:APP:sodium-extra.mixins.json:reduce_resolution_on_mac.MixinWindow,pl:mixin:APP:embeddium.mixins.json:workarounds.context_creation.WindowMixin,pl:mixin:APP:mixins.oculus.json:MixinWindow,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1170) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:alexscaves.mixins.json:client.MinecraftMixin,pl:mixin:APP:dynamiclightsreforged.mixins.json:MinecraftClientMixin,pl:mixin:APP:apoli.mixins.json:MinecraftClientMixin,pl:mixin:APP:immersive_armors.mixins.json:MixinMinecraftClient,pl:mixin:APP:carryon.mixins.json:MinecraftMixin,pl:mixin:APP:entity_model_features-common.mixins.json:MixinResourceReloadStart,pl:mixin:APP:entity_model_features-common.mixins.json:accessor.MinecraftClientAccessor,pl:mixin:APP:entity_texture_features-common.mixins.json:reloading.MixinMinecraftClient,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_PipelineManagement,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:APP:travelerstitles.mixins.json:MinecraftClientTickMixin,pl:mixin:APP:moonlight-common.mixins.json:MinecraftMixin,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:APP:flywheel.mixins.json:PausedPartialTickAccessor,pl:mixin:APP:mixins.irons_spellbooks.json:MinecraftMixin,pl:mixin:APP:immediatelyfast-common.mixins.json:core.MixinMinecraftClient,pl:mixin:APP:quark.mixins.json:client.MinecraftMixin,pl:mixin:APP:sodium-extra.mixins.json:gui.MinecraftClientAccessor,pl:mixin:APP:biomemusic.mixins.json:ClientMusicChoiceMixin,pl:mixin:APP:sound_physics_remastered.mixins.json:MinecraftMixin,pl:mixin:APP:create.mixins.json:client.WindowResizeMixin,pl:mixin:APP:embeddium.mixins.json:core.render.MinecraftAccessor,pl:mixin:APP:embeddium.mixins.json:core.MinecraftClientMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718) ~[client-1.20.1-20230612.114412-srg.jar%23420!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:alexscaves.mixins.json:client.MinecraftMixin,pl:mixin:APP:dynamiclightsreforged.mixins.json:MinecraftClientMixin,pl:mixin:APP:apoli.mixins.json:MinecraftClientMixin,pl:mixin:APP:immersive_armors.mixins.json:MixinMinecraftClient,pl:mixin:APP:carryon.mixins.json:MinecraftMixin,pl:mixin:APP:entity_model_features-common.mixins.json:MixinResourceReloadStart,pl:mixin:APP:entity_model_features-common.mixins.json:accessor.MinecraftClientAccessor,pl:mixin:APP:entity_texture_features-common.mixins.json:reloading.MixinMinecraftClient,pl:mixin:APP:mixins.oculus.json:MixinMinecraft_PipelineManagement,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:APP:travelerstitles.mixins.json:MinecraftClientTickMixin,pl:mixin:APP:moonlight-common.mixins.json:MinecraftMixin,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:APP:flywheel.mixins.json:PausedPartialTickAccessor,pl:mixin:APP:mixins.irons_spellbooks.json:MinecraftMixin,pl:mixin:APP:immediatelyfast-common.mixins.json:core.MixinMinecraftClient,pl:mixin:APP:quark.mixins.json:client.MinecraftMixin,pl:mixin:APP:sodium-extra.mixins.json:gui.MinecraftClientAccessor,pl:mixin:APP:biomemusic.mixins.json:ClientMusicChoiceMixin,pl:mixin:APP:sound_physics_remastered.mixins.json:MinecraftMixin,pl:mixin:APP:create.mixins.json:client.WindowResizeMixin,pl:mixin:APP:embeddium.mixins.json:core.render.MinecraftAccessor,pl:mixin:APP:embeddium.mixins.json:core.MinecraftClientMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:218) ~[forge-47.3.7.jar:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:flywheel.mixins.json:ClientMainMixin,pl:mixin:A,pl:runtimedistcleaner:A}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111) ~[fmlloader-1.20.1-47.3.7.jar:?] {}
at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99) ~[fmlloader-1.20.1-47.3.7.jar:?] {}
at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$makeService$0(CommonClientLaunchHandler.java:25) ~[fmlloader-1.20.1-47.3.7.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?] {}
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {}

commented

Remove smoothswapping and your issue is fixed. You can also report to them so that they finally fix the issue.

commented

Yeah the issue is on their end, definitely will report it thanks