Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting ignores item stack size restrictions on slots. #172

Open
alcatrazEscapee opened this issue May 23, 2023 · 0 comments
Open

Sorting ignores item stack size restrictions on slots. #172

alcatrazEscapee opened this issue May 23, 2023 · 0 comments

Comments

@alcatrazEscapee
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant