also break loop if we do not yet have enough ingredients (#3001)

* also break loop if we do not yet have enough ingredients

* clean up if statements
This commit is contained in:
Darkere
2021-06-12 17:05:46 +02:00
committed by GitHub
parent f596531798
commit 2128cae72b

View File

@@ -132,9 +132,11 @@ public class ProcessingNode extends Node {
if (canInsertFullAmount) { if (canInsertFullAmount) {
canInsertFullAmount = IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.SIMULATE); canInsertFullAmount = IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.SIMULATE);
} }
} else {
break;
} }
if (hasAllRequirements && !canInsertFullAmount) { if (!canInsertFullAmount) {
if (allRejected) { if (allRejected) {
this.state = ProcessingState.MACHINE_DOES_NOT_ACCEPT; this.state = ProcessingState.MACHINE_DOES_NOT_ACCEPT;
} }
@@ -144,7 +146,6 @@ public class ProcessingNode extends Node {
allRejected = false; allRejected = false;
} }
if (hasAllRequirements && canInsertFullAmount) {
this.state = ProcessingState.READY; this.state = ProcessingState.READY;
extractedItems = IoUtil.extractFromInternalItemStorage(requirements.getSingleItemRequirementSet(false), internalStorage, Action.PERFORM); extractedItems = IoUtil.extractFromInternalItemStorage(requirements.getSingleItemRequirementSet(false), internalStorage, Action.PERFORM);
@@ -161,7 +162,6 @@ public class ProcessingNode extends Node {
} }
} }
} }
}
if (originalState != state) { if (originalState != state) {
network.getCraftingManager().onTaskChanged(); network.getCraftingManager().onTaskChanged();