Inventory Sorter

Inventory Sorter

54M Downloads

Sorting ignores item stack size restrictions on slots.

alcatrazEscapee opened this issue ยท 0 comments

commented

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:

target.setCount(Math.min(itemCount, target.getMaxStackSize()));

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).)