From e53ad61d59c4f788d33688d189741e4628a417d5 Mon Sep 17 00:00:00 2001 From: Darkere Date: Sat, 22 Jan 2022 16:15:19 +0100 Subject: [PATCH] Fixed autocrafting task getting stuck if two tasks fulfilled each others requirements. Fixes #3217 A second task was able to finish a first task without the first tasks quantity reaching 0, in which case the state of the first task went from PROCESSED to READY and would never finish. Cherry picked from fdc1991c32cfc6ba4ef735641dbe8f593f745486 --- CHANGELOG.md | 1 + .../apiimpl/autocrafting/task/v6/node/ProcessingNode.java | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8007d0fae..f664fe7ad 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed multiple bugs related to transferring recipes into the Crafting Grid. - Processing patterns now use the order of items/fluids specified in the pattern by [@necauqua](https://github.com/necauqua) and [@Darkere](https://github.com/Darkere). +- Fixed autocrafting task getting stuck if two tasks fulfilled each others requirements. ## [v1.10.0-beta.4] - 2021-12-28 diff --git a/src/main/java/com/refinedmods/refinedstorage/apiimpl/autocrafting/task/v6/node/ProcessingNode.java b/src/main/java/com/refinedmods/refinedstorage/apiimpl/autocrafting/task/v6/node/ProcessingNode.java index b5a0b18c8..f6bdfc041 100644 --- a/src/main/java/com/refinedmods/refinedstorage/apiimpl/autocrafting/task/v6/node/ProcessingNode.java +++ b/src/main/java/com/refinedmods/refinedstorage/apiimpl/autocrafting/task/v6/node/ProcessingNode.java @@ -73,7 +73,7 @@ public class ProcessingNode extends Node { @Override public void update(INetwork network, int ticks, NodeList nodes, IStorageDisk internalStorage, IStorageDisk internalFluidStorage, NodeListener listener) { if (getQuantity() <= 0) { - if (state == ProcessingState.PROCESSED) { + if (totalQuantity == quantityFinished) { listener.onAllDone(this); } return; @@ -243,10 +243,6 @@ public class ProcessingNode extends Node { } this.quantityFinished = tempQuantityFinished; - - if (this.quantityFinished == this.totalQuantity) { - this.state = ProcessingState.PROCESSED; - } } @Override