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
This commit is contained in:
@@ -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.
|
- Fixed multiple bugs related to transferring recipes into the Crafting Grid.
|
||||||
- Processing patterns now use the order of items/fluids specified in the pattern
|
- 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).
|
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
|
## [v1.10.0-beta.4] - 2021-12-28
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ public class ProcessingNode extends Node {
|
|||||||
@Override
|
@Override
|
||||||
public void update(INetwork network, int ticks, NodeList nodes, IStorageDisk<ItemStack> internalStorage, IStorageDisk<FluidStack> internalFluidStorage, NodeListener listener) {
|
public void update(INetwork network, int ticks, NodeList nodes, IStorageDisk<ItemStack> internalStorage, IStorageDisk<FluidStack> internalFluidStorage, NodeListener listener) {
|
||||||
if (getQuantity() <= 0) {
|
if (getQuantity() <= 0) {
|
||||||
if (state == ProcessingState.PROCESSED) {
|
if (totalQuantity == quantityFinished) {
|
||||||
listener.onAllDone(this);
|
listener.onAllDone(this);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -243,10 +243,6 @@ public class ProcessingNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.quantityFinished = tempQuantityFinished;
|
this.quantityFinished = tempQuantityFinished;
|
||||||
|
|
||||||
if (this.quantityFinished == this.totalQuantity) {
|
|
||||||
this.state = ProcessingState.PROCESSED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user