inventorysorter icon indicating copy to clipboard operation
inventorysorter copied to clipboard

Sorting ignores item stack size restrictions on slots.

Open alcatrazEscapee opened this issue 1 year ago • 0 comments

As an example, using the TerraFirmaCraft mod, which has a stack-size 16 slot in small vessels, inventory sorter will sort items into these slots ignoring the stack size restriction of the slot (as opposed to the stack).

With a quick look, I believe this is due to not properly checking stack limits here:

https://github.com/cpw/inventorysorter/blob/44601da8044fb492d4387e15a0513d1a3f728ae8/src/main/java/cpw/mods/inventorysorter/SortingHandler.java#L153

It is not sufficient to check ItemStack.getMaxStackSize(), you should be taking the minimum of that and Slot.getMaxStackSize() (or, use the method Slot.getMaxStackSize(ItemStack).)

alcatrazEscapee avatar May 23 '23 15:05 alcatrazEscapee