Item Conduits fail to honor can extract from slot with Reconstructor
brisingraerowing opened this issue ยท 5 comments
Issue Description:
Item Conduits cause a dupe bug with the Reconstructor mod, as they will always extract an item even if the item isn't fully repaired.
Ref: smbarbour/Reconstructor#7
What happens:
Items get duped every tick
What you expected to happen:
No duping
Steps to reproduce:
- Place and power a Reconstructor
- Put an extracting item conduit on the bottom and connect it to another inventory
- Put a damaged item in the Reconstructor.
- Observe item getting duped
Affected Versions (Do not use "latest"):
- EnderIO: 5.2.59
- EnderCore: 0.5.76
- Minecraft: 1.12.2
- Forge: 14.23.5.2854
- SpongeForge? no
- Optifine? no
- Single Player (not tested on server)
Your most recent log file where the issue was present:
Logs currently unavailable. I'll get one as soon as I can.
Items are inserted into the destination inventory before performing the actual extraction, which fails.
You may have missed the code leading up to that: https://github.com/SleepyTrousers/EnderIO/blob/c09dc117660de265a2619fb42134744d49924fec/enderio-conduits/src/main/java/crazypants/enderio/conduits/conduit/item/NetworkedInventory.java#L151-L174
The point is that the actual result of the extract should be used to insert into the destination instead of the result of the simulation. The Forge InvWrapper does not use the same calls for simulation and the actual extract. This is correctly handled by every other item transport system.
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/main/java/net/minecraftforge/items/wrapper/InvWrapper.java#L160-L193
In the simulation, it copies the stack. In the actual extract, it calls the code to extract the item (which is where the code that checks if the item is extractable was located). The code in EnderIO even acknowledges that there is a dupe issue (by checking for and logging the dupes).
This is an issue. Whether or not you choose to view it as a bug, is irrelevant. This has been mitigated in my own mod. Other mods may reflect the same issue. You can choose to correct the issue by using the result of the extract instead of the simulation, or you can choose to continue to allow the dupes and simply log them.