Crash when shift-clicking new book -> old book recipe
NielsPilgaard opened this issue ยท 12 comments
Describe the bug
When crafting the new Occultism guide into the old, if you hold shift while taking the result you'll crash.
To Reproduce
Steps to reproduce the behavior:
- Place new guide book in the 2x2 inventory crafting "table"
- Hold shift
- Click recipe output
- See error
Expected behavior
For the new guide book to be consumed, and the old guide book to be the recipe result.
Screenshots
If applicable, add screenshots to help explain your problem.
System (please complete the following information):
- Occultism Version: occultism-1.19.2-1.48.0
- OS: [e.g. Windows] Windows 10
- Minecraft Version: 1.19.2
- Modpack Link and Version, or list of mods: Enigmatica 9 1.1.1 in-dev, should also work in E9 1.1.0 release
Additional context
Latest.log: https://gist.github.com/NielsPilgaard/eed1a7df73010e3ef40a4bf8eef32925
No crash report was produced, and the latest.log isn't helpful tbf
Hmm that is a bit odd. That recipe is a normal vanilla recipe, and the original book remaining is intentional (using the forge (or vanilla? not sure) "empty" bucket mechanics)
On a quick test it doesn't repro with just occultism + dependencies in curseforge, there it just fills the inventory with guide books.
Going to try and attach the debugger to enigmatica to see if there is anything obvious going on.
I suspect we have an adverse mod interaction here, but I am honestly not sure what it could possibly be
On the plus side, it's reproducible, I just did it again ๐ It occurs in both SP and on a server
Yeah it definitely reproduces in Enigmatica
I think the underlying issue might be an incompatibility with a mod that modifies vanilla crafting (maybe for cache/performance reasons?). It seems to go in an endless loop with the shift craft, I assume because said mod does not expect a recipe to remain available indefinitely - unpatched vanilla handles that by stopping the crafting when the inventory is full, but here it seems to go on forever.
Sadly I cannot debug exactly what is happening, because the forge/vanilla item code I have in my dev env does not match the bytecode in enigmatica. I adjusted my forge version and will retry, but it might be due to mixins
EDIT: yeah with matching forge versions ItemStack and other vanilla classes still don't match in large parts.
@NielsPilgaard There are multiple possible ways forward:
- As a quick fix, Enigmatica can do their own recipe for the old dictionary of spirits, maybe just a shapeless with two datura seeds instead of one:
{ "type": "minecraft:crafting_shapeless", "ingredients": [ { "item": "occultism:datura_seeds" }, { "item": "occultism:datura_seeds" }, { "item": "minecraft:book" } ], "result": { "item": "occultism:dictionary_of_spirits" } }
- Occultism can make the old book consume the new. I wanted to avoid that because with every other patch people need the new one more and more and may get disconnected from their progress if it is suddenly gone
- Occultism can introduce the above recipe
- We somehow identify what mods may be modifying/optimizing/interacting with the crafting system and open dialogue with them
I'd prefer option 1 followed by option 4, seems the least disruptive overall.
Perhaps FastWorkbench is the culprit.
@Shadows-of-Fire we're experiencing an issue where crafting an item where the ingredients are never consumed causes an infinite loop, resulting in a deadlock. Could FastWorkbench have anything to do with that?
Maybe, but that would require the recipe doing someyhing exceptionally weird. You can test it very easily by removing fb though.
Is this recipe using a custom class with special logic?
Based on context I assume this is the recipe in question https://github.com/klikli-dev/occultism/blob/version/1.19/src/main/resources/data/occultism/recipes/crafting/dictionary_of_spirits_old_edition.json
and I can also assume the original book container items itself, which yields an infinite cycle of crafting since it will never stop matching.
If those assumptions are correct:
This is (imo) a weird recipe. I'm not sure why it's deadlocking with FB (FB should abort when the inventory is full) but a recipe that consumes none of the inputs (thus always matching) sounds like it will also cause issues elsewhere.
I'll see why/if fb isnt aborting when full though.
Okay so under normal conditions FB does not deadlock while the inventory is full - you can check this by trying to shift craft anything with a full inventory. The code responsible is here https://github.com/Shadows-of-Fire/FastWorkbench/blob/1.19/src/main/java/shadows/fastbench/util/FastBenchUtil.java#L96 which early returns if the merge fails.
I think the best solution is to add a second item to that recipe which is consumed in the crafting process, as there are likely other side effects to having a recipe that can infinitely produce an item.
That sounds like the best possible solution, just craft it with another datura I guess, breaks the cycle - I'll do that next update
Thanks for looking into it!