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
147 stars 69 forks source link

Fix NPE #12

Closed p455w0rd closed 6 years ago

p455w0rd commented 6 years ago

Fixes https://github.com/maruohon/itemscroller/issues/11

maruohon commented 6 years ago

Did you try this fix yourself? It doesn't fix the crash in my testing... and this isn't even the issue it seems. The game crashes inside the SlotItemHandler#getItemStackLimit() method because getItemHandler() returns null. So it seems like a bug in WCT, as you don't either have a custom slot or it doesn't override some of the methods (getItemStackLimit() maybe?) to prevent this.

Edit: To clarify, this crash occurs when scrolling over a slot in the terminal that does have items in it, thus your fix isn't even applicable here.

Edit2: And actually, the slot.getHasStack() check already happens on line 120 via isValidSlot().

maruohon commented 6 years ago

Closing this as invalid/unapplicable, as discussed on Discord