Bad insertion logic causes duplication
rlnt opened this issue ยท 1 comments
Bug description
Your insertion logic is very error-prone. A lot of mods return an empty item stack when everything was inserted following vanilla/forge conventions. You have no security measure that even checks if the same item type is being returned and only compare the two stack counts.
This results in marking a perfectly inserted item as non-fitting and causes duplication. An empty item stack is 1x air
so when a single item is inserted, the counts of the two stacks are not different.
Expected behavior
You should do a security check if it's the same item type. Or check if the item stack is empty. Or save the count to a local variable before the insertion so you have a primitive that is not mutated during the insertion.
Anything but the current logic.
Versions
- Minecraft version: 1.19.2
- Forge version: 43.2.1
- Mod version: 1.19.2-1.0.1