Refined Storage

Refined Storage

115M Downloads

Autocrafting Request Completes Before Processing All Items

RoboXGamer opened this issue ยท 4 comments

commented

Describe the bug

Description

The autocrafting system in Refined Storage appears to complete a crafting request before all the items have been processed.
Example I tested, the user requests 64 charcoal to be created. The system completes the request of creating 64 charcoal but has yet to finish processing the 64 logs that were needed to make 64 charcoal. The system did not even put all the 64 logs as the input to the machine yet.

Expected Behavior

The Refined Storage autocrafting system should wait until all input items for a crafting recipe have been fully processed and the requested items are output before considering the crafting request complete. The task should not be marked as completed while the input items are still visibly being processed. System should only complete the request when all output items are received back into the network.

Additional Information

  • The attached video recording provides a clear demonstration of the issue in action: Recording

How can we reproduce this bug or crash?

  1. Set up a Refined Storage autocrafting system with a Crafter, Processing Pattern , Crafting Grid, Controller, and a interface where returning back the output from the processing machine. (for the example here was the furnace)
  2. Create a processing pattern for crafting charcoal from logs in a furnace.
  3. Place a large quantity of logs into the Refined Storage network's storage system.
  4. Request a large quantity of charcoal (e.g., 64) via the crafting grid.
  5. Observe the furnace and autocrafting monitor. The task will be listed as finished despite not all logs being processed to be charcoal in the storage network.

What Minecraft version is this happening on?

Minecraft 1.21.1

What NeoForge or Fabric version is this happening on?

21.1.119

What Refined Storage version is this happening on?

refinedstorage-neoforge-2.0.0-milestone.4.13

Relevant log output

commented

One more info here:
I watched my own recording many times now and notice that i dont have any storage setup for refined
there is no disk drive or storage block attached.
So I think what could be the issue is that it is trying to put the 1 charcoal that was processed back into the system from the interface but is not able to put it anywhere and continously checking in loop and that way the logic for completing the autocrafter is getting triggered somehow even though the item never came back to system. This is a edge case i would say but could be better to fix the logic to not count the output item multiple times if it cant fit that into the system

commented

Thank you for the comprehensive bug report.

What is happening here is the following:

  • When a charcoal is dumped in the Interface, the Interface will try to to move it to the network storage
  • Before the network storage processes the charcoal, it will first notify autocrafting that something will be inserted
  • Your task is notified that charcoal will be inserted
  • Because charcoal is an output of your root pattern, the charcoal is not intercepted by the autocrafting task for storing in intermediate task storage. This means the charcoal will go in your network storage, which is good.
  • The charcoal is not intercepted by the autocrafting task, but the task is "satisfied" (so it can actually complete)
  • After satisfying the task, an attempt is made to dump the charcoal in network storage
  • There is no space in the network storage, so this fails.
  • Repeat this for a few attempts, and your task will be completed entirely rather quickly.

The core problem seems to be that autocrafting is satisfied before checking if there's even space in the network storage.

commented

Yup same thing I also expected is happening
So the solution would be to add a check for space in network before satisfying the crafting task

commented

Essentially, yes.
The current solution in my head to achieve this is to split up the interceptions in before insert / after insert.
After insert would be used in cases where the intermediate task storage is not used, like for root outputs in processing.