After removing items from moving contraption by shift-clicking, the contraption cannot be disassembled properly and could duplicated
RanolP opened this issue ยท 2 comments
Describe the Bug
Extract an item from a moving contraption assembled by shift-clicking, and disassemble the contraption. It crashes (or logs an error) with the message java.lang.IllegalArgumentException: Transfer variant may not be blank.
.
Reproduction Steps
- Construct any moving contraption with an attached chest containing some items (maybe reproducible with other storage blocks e.g. barrel) - I had reproduced w/ windmill (not crashes, but could lead to dupe bug in Singleplayer), minecart (crashes, see the comment from #1211 (comment) for vids), gantry (crashes)
- Remove item from the inventory by shift-clicking
- Disassemble the contraption
Expected Result
It should be disassembled properly
Screenshots and Videos
output.webm
Crash Report or Log
No response
Operating System
Windows 11
Mod Version
0.5.1d
Minecraft Version
1.20.1
Other Mods
- EMI 1.0.9
- Trinkets 3.7.0
- ModMenu 7.1.0
Additional Context
Related Issues
- #1080 (and issues marked as duplicates)
- #1208
- #1134 - Discovered most of the reason, see #1134 (comment)
- #1211
Possible Solutions
- I have locally fixed the issue by copying the return value (L102) of
StorageInteractionContainer.getItem
in my dev env. It seems that the shift-click interaction modifies the return value of getItem directly. But I have no idea if the solution could produce other side effects.
- Another possible solution is changing the Porting-Lib code. Apply the isEmpty filter whenever
ItemStackHandler.nonEmptyViews
is called.
https://github.com/Fabricators-of-Create/Porting-Lib/blob/41c9aacb30f43e0993c63f1da4438e1943fc6697/transfer/src/main/java/io/github/fabricators_of_create/porting_lib/transfer/item/ItemStackHandler.java#L101-L111
I've had this one too, with gantries.
It seems removing a stack (through shift clicking or not) of a moving contraption causes it.
duplicate of #1080