Skip to content

Add game tests reproducing crafting interface single-use bug (issue #188)#190

Closed
Copilot wants to merge 2 commits intomaster-1.21-ltsfrom
copilot/fix-crafting-interface-issue
Closed

Add game tests reproducing crafting interface single-use bug (issue #188)#190
Copilot wants to merge 2 commits intomaster-1.21-ltsfrom
copilot/fix-crafting-interface-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

The crafting interface stops processing after the first recipe entry when using a non-crafting-table crafter (e.g. furnace): in blocking mode only the first item is produced and remaining ingredients drop from the interface; in non-blocking mode a second crafting request is silently dropped.

Root cause (identified, not yet fixed)

PendingCraftingJobResultIndexObserver is registered only as an insertPreConsumer, which fires exclusively when items are explicitly inserted via the network's insert API (e.g. an importer part). Items arriving via hoppers or any mechanism that bypasses IngredientChannelAdapter.insert() never trigger the observer. The crafting job stays permanently stuck in processingCraftingJobs, blocking all subsequent requests since processingJobs >= maxProcessingJobs.

Changes

  • Game tests added (testItemsCraftFurnaceBlockingMultiple, testItemsCraftFurnaceSecondRequest) — cover blocking-mode multi-item sequential processing and second-request re-trigger via crafting writer. These tests use an importer and currently pass (they do not yet reproduce the hopper-path failure).

Known gap

Tests do not yet reproduce the actual user-facing failure path (hopper-based output bypassing the insert API). The fix requires PendingCraftingJobResultIndexObserver to also implement IIngredientComponentStorageObservable.IIndexChangeObserver and register via addObserver, so that onChange(ADDITION) events from the ingredient observer also call addIngredient(...) — covering items that arrive through observation rather than explicit insert.

Original prompt

This section details on the original issue you should resolve

<issue_title>Crafting Interface stops processing after single use</issue_title>
<issue_description>

Issue type:

  • 🐛 Bug

Short description:

When a crafting plan is initiated for multiple instances of a recipe on a "crafter" that is NOT a crafting table, it stops processing after the first instance of the recipe when the Crafting Interface is in blocking mode or after the first "run" when in non-blocking mode (so that subsequent calls to that recipe do not process.)

Items used in the crafting plan get "stuck" in the Crafting Interface and will drop when the Interface is broken.

Steps to reproduce the problem:

  1. Set up a simple network with a chest a hopper pointing into the chest and a furnace on top the hopper.
  2. Place a stack of coal in the Furnace fuel slot and a stack of Sand in the chest.
  3. Place an Item Interface on top of the chest and a Crafting Interface on top of the Furnace and cable them together.
  4. Add a Storage Terminal and Crafting Terminal for viewing/interacting.
  5. Create a recipe for glass from sand and place it in the Crafting Interface. (Leave the interface in blocking mode)
  6. Use the Storage Terminal to craft a single instance of the Glass recipe.
  7. The furnace should kick off and craft the glass successfully. NOTE that while smelting takes place the Crafting Terminal DOES NOT show the Crafting Plan!
  8. Once completed and the glass is the chest, use the Storage Terminal to craft another instance of the Glass recipe.
  9. The sand does NOT get put into the Furnace. The Crafting Terminal DOES NOT show the plan.
  10. Break the Crafting Interface. It will drop the Interface, the Variable for the Glass Recipe and the Sand.
  11. Replace the Crafting Interface and put the Recipe back in. Leave the Interface in Blocking Mode.
  12. Use the Storage Terminal to craft 4 Glass.
  13. The furnace will get the first block of Sand and make a block of Glass, however, after the first one, it will NOT continue to the others. AGAIN, the Crafting Terminal shows nothing.
  14. Break the Crafting Interface. It will drop the Interface, the Variable with the Recipe and the remaining 3 Sand.
  15. Replace the Crafting Interface and put the Recipe back in.
  16. Turn OFF Blocking Mode on the Crafting Interface.
  17. Use the Storage Terminal to Craft 4 Glass. 4 Sand will go into the Furnace, as expected, and smelt. NOTE: Here again the Crafting Terminal shows nothing.
  18. Once the smelting is completed, use the Craft Terminal to craft more Glass. The Sand will NOT go into the Furnace, the Crafting Terminal shows nothing and, if you break the Crafting Interface the Sand will again drop.

Expected behaviour:

Repeated crafting of the same recipe should process to completion whether crafting multiple items when in Blocking Mode or multiple requests to craft when in non-Blocking Mode. Active crafting plans should display in the Crafting Terminal until they complete.


Versions:

  • This mod: 1.21.1-neoforge-1.4.4.514
  • Minecraft: 1.21.1
  • Mod loader version: NeoForge 21.1.10

Only Integrated Crafting, Integrated Terminals and their required mods are loaded.

Log file:

</issue_description>

<agent_instructions>Try to reproduce this issue by creating new game tests. Specifically, focus on steps 12 and 13 (storage terminal is not available, so trigger jobs using the crafting writer).
Please make a PR with these new game tests, and they should fail according to how it's described in this issue.
We will look into fixing this issue later, so no need to do it here.
If you can not reproduce the problem, that's fine as well, just make a game test then that closely resembles the issue, so I can take it from there.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@rubensworks

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

)

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix crafting interface to allow multiple recipe instances Add game tests reproducing furnace crafting interface stops after single use (#186) Mar 4, 2026
Copilot AI changed the title Add game tests reproducing furnace crafting interface stops after single use (#186) Add game tests reproducing crafting interface single-use bug (issue #188) Mar 4, 2026
@rubensworks rubensworks closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crafting Interface stops processing after single use

2 participants