Skip to content

Compacting drawer item duplication fix for 1.16#1017

Merged
jaquadro merged 1 commit into1.16from
1.16-CompDrawerDupeFix
Apr 28, 2022
Merged

Compacting drawer item duplication fix for 1.16#1017
jaquadro merged 1 commit into1.16from
1.16-CompDrawerDupeFix

Conversation

@Quinteger
Copy link
Copy Markdown
Collaborator

This PR is a 1.16 backport fix for the item duplication bug outlined in issue #1009. The 1.18 version of the fix will be located in this PR: #1016 (though the actual code chages are the same).

The bug happens after fully taking out items from a compacting drawer and then putting in a different item, which takes up less slots in the drawer (has less compacting variants).

For example, a drawer stored iron blocks, ingots and nuggets. Player takes out all of them (the drawer becomes empty) and puts in clay. Clay has only 2 compacting variants as opposed to iron's 3 - clay blocks and clay balls. This is when the error happens - the cached value for the 3rd drawer doesn't get reset and still holds iron nuggets. However, the bug isn't noticeable yet, as all the slots are currently being built from scratch and the cache is untouched.
Problems start when you fully take out clay and put it in again. This time, the input item matches the cached value, so slots get loaded from the cache in their entirety, resulting in a drawer with clay blocks, clay balls and iron ingots.

The fix makes sure that all remaining slots get reset instead of ending the loop early.
Additionaly, some minor changes were made to build.gradle to make sure that the project loads properly.

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