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

[1.21] Fix empty slots having a slot limit of 1 in ItemStackHandler. #131

Closed

Conversation

MerchantPug
Copy link

By using ItemStack#getMaxStackSize, you are limiting any empty slot to have a slot limit of 1, as that defaults to 1 when there is no max stack size component present (empty stacks don't have it).

The fix is to instead getOrDefault the stack size component and default it to max value, that way, mods that increase the max stack size further than 99 can also be slotted into empty slots.

@MerchantPug MerchantPug changed the title Fix empty slots having a slot limit of 1. [1.21] Fix empty slots having a slot limit of 1 in ItemStackHandler. Aug 25, 2024
@IThundxr
Copy link
Member

I'm not entirely sure setting it to int max value is the best fix here, previously ItemStack#EMPTY had a stacksize of 64 so ideally it'd default to the default stack size

@MerchantPug
Copy link
Author

MerchantPug commented Aug 25, 2024

I'm not entirely sure setting it to int max value is the best fix here, previously ItemStack#EMPTY had a stacksize of 64 so ideally it'd default to the default stack size

That's fair, I'll change it then.

@MerchantPug
Copy link
Author

accident!

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

Successfully merging this pull request may close these issues.

2 participants