Pipez

Pipez

31M Downloads

Bad insertion logic causes duplication

rlnt opened this issue ยท 1 comments

commented

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.

https://github.com/henkelmax/pipez/blob/1.19.2/src/main/java/de/maxhenkel/pipez/blocks/tileentity/types/ItemPipeType.java#L162-L167

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
commented

Nevermind, that happens only when the original stack is being modified which is not supposed to be done anyways.