BiscuitDevelopment / SkyblockAddons

A Minecraft Forge mod with helpful Hypixel skyblock features!
Other
484 stars 238 forks source link

[Bug] Tried to remove listener from null inventory #658

Open TheDGOfficial opened 2 years ago

TheDGOfficial commented 2 years ago

Describe the bug This error used to just send a chat message on older versions (i don't remember which) but I guess you guys just removed a try catch or something, and now it crashes my game. It happens ocassionally, but randomly. It happens when clicking in menus.

Right now it happened when i clicked Enrichments on Bits shop. But generally it happens clicking on a backpack or ender chest on my storage. This the first time it happened on Bit Shop, but it also happened when clicking on Bazaar before, so i believe its a general menu thing.

Please make it not crash the game by adding a try catch like on old versions and send the error message to chat, or better add a null check at where the error occurs, so the error doesn't occur at all.

To Reproduce Happens randomly, no idea.

Expected behavior No NullPointerException, or at least no crashes.

Screenshots/Video Not applicable

Crash Report

Description: Updating screen events

java.lang.NullPointerException: Tried to remove listener from null inventory.
    at codes.biscuit.skyblockaddons.listeners.GuiScreenListener.removeInventoryChangeListener(GuiScreenListener.java:259)
    at codes.biscuit.skyblockaddons.listeners.GuiScreenListener.onInventoryLoadingDone(GuiScreenListener.java:154)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_507_GuiScreenListener_onInventoryLoadingDone_InventoryLoadingDoneEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
    at codes.biscuit.skyblockaddons.listeners.GuiScreenListener.onInventoryChanged(GuiScreenListener.java:212)
    at codes.biscuit.skyblockaddons.listeners.InventoryChangeListener.onInventoryChanged(InventoryChangeListener.java:32)
    at net.minecraft.inventory.InventoryBasic.markDirty(SourceFile:159)
    at net.minecraft.inventory.Slot.onSlotChanged(Slot.java:76)
    at net.minecraft.inventory.Slot.onPickupFromSlot(Slot.java:50)
    at net.minecraft.inventory.Container.slotClick(Container.java:314)
    at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:488)
    at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:629)
    at net.minecraft.client.gui.inventory.GuiChest.handleMouseClick(SourceFile)
    at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:388)
    at net.minecraft.client.gui.inventory.GuiChest.mouseClicked(SourceFile)
    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:120)
    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:524)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1674)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1024)
    at net.minecraft.client.Minecraft.run(Minecraft.java:349)
    at net.minecraft.client.main.Main.main(SourceFile:124)
    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 gg.essential.loader.stage2.relaunch.Relaunch.relaunch(Relaunch.java:124)
    at gg.essential.loader.stage2.EssentialLoader.preloadEssential(EssentialLoader.java:168)
    at gg.essential.loader.stage2.EssentialLoader.loadPlatform(EssentialLoader.java:114)
    at gg.essential.loader.stage2.EssentialLoaderBase.load(EssentialLoaderBase.java:192)
    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 gg.essential.loader.stage1.EssentialLoaderBase.load(EssentialLoaderBase.java:110)
    at gg.essential.loader.stage1.EssentialSetupTweaker.<init>(EssentialSetupTweaker.java:44)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at gg.essential.loader.stage0.EssentialSetupTweaker.loadStage1(EssentialSetupTweaker.java:53)
    at gg.essential.loader.stage0.EssentialSetupTweaker.<init>(EssentialSetupTweaker.java:26)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:98)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

System Information

Other Installed Mods

DaemonUmbra commented 2 years ago

I would recommend trying without the Essential mod, I've dug into it a little bit and it is disgusting in how much it hacks about with downloading and installing itself on-the-fly