maruohon / itemscroller

A client-side Minecraft mod that adds various convenient ways of moving items within inventory GUIs, such as scrolling over stacks to move single items to or from it
GNU Lesser General Public License v3.0
150 stars 77 forks source link

Crash with In-Game Wiki: NullPointerException: Updating screen events #14

Open Xiaminou opened 6 years ago

Xiaminou commented 6 years ago

Crashed while browsing the In-Game Wiki (scrolling through the page). Crash Report: crash-2017-11-15_18.45.33-client.txt

maruohon commented 6 years ago

Could you try this:

Based on the crash log, the crash seems to happen in vanilla slot clicking code, and Item Scroller simply emulates regular slot clicks (shift clicks in this case). So the bug is likely in the Container or inventory code of whichever mod the GUI screen belongs to where this happened. The exact line numbers in crash logs don't usually match to my IDE so it's a bit hard to tell without reproducing the crash myself, but it might have been due to a null ItemStack in some inventory slot, which shouldn't exist anymore starting from MC 1.11. If the above test (clicking while Item Scroller is toggled off or disabled completely) still crashes the game, then that assumption is correct and the crash should be reported to the mod to which the GUI screen belongs to where the crash happens (I don't know how in-game wiki works and if the GUI belongs to it?).

If this happened in some in-game wiki screen, I assume item movement shouldn't even happen in such screens? Or are there still actual inventory slots visible in those screens where you would need to move items? I'm just wondering if those screens should be blacklisted from Item Scroller.

Xiaminou commented 6 years ago

Alright, it doesn't crash anymore. Maybe it was just an issue with the early alpha of IGW. The only issues I had were not being able to scroll up while pointing at items in recipes and ctrl + scrolling picking up items from the recipes which won't show up anymore until you restart minecraft. But that's just bad interaction between the mods, not sure which side is responsible for compatibility. Video for clarification: https://youtu.be/uG-EpLFSmg8

maruohon commented 6 years ago

Hah, that is interesting. Like I said, Item Scroller just emulates slot clicks of various kinds... so I'm interested whether or not that items getting picked up can be achieved by some of the vanilla inventory actions (left or right clicking, with or without shift) while Item Scroller is disabled? If not, then it might be caused by some of the methods in Item Scroller that try to count items and check where they can be moved etc, meaning that it would then be Item Scroller's fault.

But based on that video, it seems that Item Scroller simply shouldn't be usable at all in the IGW GUIs. I'll need to add it to the GUI blacklist by default, but that won't take effect for existing installations due to the old config... well I guess I could add code to update the config based on version numbers. You can also blacklist it yourself, by using the debug key combination (I think it was Ctrl + Alt + Shift + I while not hovering over any slots?) in the IGW GUI to find out the GUI class name (printed to the game console), and then adding that to the Item Scroller config's GUI blacklist. That should prevent Item Scroller from doing anything in the IGW GUIs. I wonder if all those GUIs use the same class though...