Autocrafting Stuck: Prepared Ingredient Substitution Not Used When Crafting
Niko-O opened this issue ยท 0 comments
Describe the bug
When there are two autocrafting recipes present that create a crafting chain, with the first recipe accepting substitutions but not the second one, autocrafting calculates ingredients correctly with a substitution for the first step, but actual crafting is done with the non-substituted ingredients that were intended for the second step. That second crafting step now can't complete because it does not accept the leftover (substituted) ingredients.
Example:
2x Oak Planks -> 4x Stick
, Substitutions enabled
6x Oak Planks + 1x Stick -> 3x Oak Sign
, Substitutions disabled
When crafting 12x Oak Sign
, autocrafting correctly reserves 26x Oak Planks
if they are available. But if only 24x Oak Planks
are available, it correctly reserves an additional 2x Birch Planks
(substitute items for Oak Planks
) to craft the Stick
s with, and 24x Oak Planks
for the Oak Sign
s. However, the actual crafting will use Oak Planks
for the Stick
s, which is wrong, because now there are not enough remaining Oak Planks
to craft the actual Oak Sign
s, since those don't accept the Birch Planks
.
How to reproduce the bug
Used test setup:
Creative Energy Cell
ME Chest
with256k ME Item Storage Cell
256k Crafting Storage
ME Pattern Provider
Molecular Assembler
- An
ME Pattern Encoding Terminal
on a piece ofFluix ME Glass Cable
Two Crafting Pattern
s created in the ME Pattern Encoding Terminal
:
2x Oak Planks -> 4x Stick
, Substitutions enabled6x Oak Planks + 1x Stick -> 3x Oak Sign
, Substitutions disabled
Patterns placed in the ME Pattern Provider
. The order does not seem to matter.
2x Birch Planks
and 24x Oak Planks
stored in the system. This is exactly enough material to craft 12 Oak Sign
s, using the two Birch Planks
to create the Stick
s.
To trigger the problem, trigger a crafting request by clicking on the Oak Sign
autocraftable, selecting 12 Oak Sign
s and clicking "Next" in the "Select Amount" screen and finally "Start" in the "Crafting Plan" screen.
Note that the available ingredients are sufficient, according to the Crafting Plan.
Click on the hammer button (top right corner) to open the autocrafting status UI and observe the stuck autocrafting job.
It will eventually settle on this state:
- Scheduled: 3x
Oak Sign
- Available: 4x
Oak Planks
- Available: 2x
Birch Planks
- Available: 1x
Stick
This is because two Oak Planks
were used to craft the sticks, but the Oak Sign
cannot be crafted with Birch Planks
, so it's stuck now.
This does not cause anything to be written to the console.
Following these steps reproduces the issue every time.
Expected behavior
Autocrafting should use the same exact ingredients for each performed crafting step that were calculated in the crafting plan.
In the example above, the 2x Oak Planks -> 4x Stick
crafting step should use the Birch Planks
that were originally selected as a substitution for it, instead of choosing the Oak Planks
that were selected for the 6x Oak Planks + 1x Stick -> 3x Oak Sign
crafting step.
Additional details
This problem originally surfaced while playing the "All the Mods 9" pack (with the recipe chain Oak Planks -> Chest -> Oak Drawer
), but it is perfectly reproducable with just:
- Minecraft 1.20.1
- Forge 47.2.19
- LWJGL 3 3.3.1 (Automatically selected by Prism Launcher)
- Applied Energistics 2 15.0.20
And no other mods installed.
Special thanks to @n4imLess for testing this with me.
Which minecraft version are you using?
1.20
On which mod loaders does it happen?
Forge
Crash log
https://gist.github.com/Niko-O/0053f7fcb9b8195a20c5df8f364eac90