Mechanical Crafter deletes items and crashes the game when a recipe returns air
object-Object opened this issue ยท 1 comments
Describe the Bug
When a valid recipe (ie. one where the inputs match) which returns air is put into the Mechanical Crafter, it deletes the input items and, if a container is connected to the output, the game crashes.
I encountered this bug when using CraftTweaker's recipe functions feature to conditionally allow a recipe to be crafted or not based on the NBT of the inputs, but it would probably be triggered by any recipe added by a mod or datapack which returns air.
Reproduction Steps
- Install Create and CraftTweaker.
- Add the following script to a file (eg.
air.zs
) in.minecraft/scripts
:
craftingTable.addShapeless("returns_air", <item:minecraft:air>, [<item:minecraft:dirt>], null);
- Start the game and put a dirt block into a single Mechanical Crafter to craft the recipe. Add a chest to the output if you want to see the crash.
Expected Result
The recipe should be treated like any other invalid recipe, ie. the inputs should pop out of the crafter.
Screenshots and Videos
2023-05-28_02-55-26.mp4
Note: the issue also happens with larger/shaped recipes, this was just the most minimal example I could come up with.
Crash Report or Log
Operating System
Windows 11
Mod Version
0.5.0i
Minecraft Version
1.19.2
Other Mods
Fabric API 0.76.0+1.19.2
CraftTweaker 10.1.44
Ingredient Extension API 3.0.6
Additional Context
Here's the actual CraftTweaker script where I discovered this issue: merge_phials.zs. Note that unlike the above example, it doesn't always return air; it's conditional based on the inputs.