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

Fix multiple duplication bugs and NPE #209

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jackodsteel
Copy link

@jackodsteel jackodsteel commented Apr 29, 2020

Fix #185 where it removes 2 but only gives one lootbag when shift clicking

Fix #188 fix #178 where using the number keys gives a stack when it should only give 1.

Pretty sure it fixes #191, although their description seems the opposite of the bug I'm seeing.

Also fixed two bugs I found myself. One where using pipes (tested with EnderIO), it will extract a larger number of bags than it removes, thus duping bags.
Second, a null pointer when interacting with the bags GUI sometimes.

Reworked the slotClick and transferStackInSlot logic.
I'm not 100% sure what was causing the errors, but these refactors have fixed
- Bug where shift clicking items out used 2 items but only gave 1
- Bug where using the number keys to remove items duped huge amounts
Tested with EnderIO. Previously when using EnderIO item conduits, it would attempt to take multiple items (and add that many to the input inventory), but only decrement storage by 1.
Now correctly handle the case where item cables try to extract more than one item at a time.
Sometimes this method gets called with slotPos -999, not sure why, but just put a check to ignore any events that have a slotPos outside the expected bounds and this fixes it.
@jackodsteel
Copy link
Author

Hey @Malorolam, any chance of you taking a look at this PR? Happy to help with general maintainance too if you'd like, for example replying to/closing issues.

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