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) {
canInsertFullAmount = IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.SIMULATE);
}
} else {
break;
}
if (hasAllRequirements && !canInsertFullAmount) {
if (!canInsertFullAmount) {
if (allRejected) {
this.state = ProcessingState.MACHINE_DOES_NOT_ACCEPT;
}
@@ -144,21 +146,19 @@ public class ProcessingNode extends Node {
allRejected = false;
}
if (hasAllRequirements && canInsertFullAmount) {
this.state = ProcessingState.READY;
this.state = ProcessingState.READY;
extractedItems = IoUtil.extractFromInternalItemStorage(requirements.getSingleItemRequirementSet(false), internalStorage, Action.PERFORM);
extractedFluids = IoUtil.extractFromInternalFluidStorage(requirements.getSingleFluidRequirementSet(false), internalFluidStorage, Action.PERFORM);
extractedItems = IoUtil.extractFromInternalItemStorage(requirements.getSingleItemRequirementSet(false), internalStorage, Action.PERFORM);
extractedFluids = IoUtil.extractFromInternalFluidStorage(requirements.getSingleFluidRequirementSet(false), internalFluidStorage, Action.PERFORM);
IoUtil.insertIntoInventory(container.getConnectedInventory(), extractedItems.getStacks(), Action.PERFORM);
IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.PERFORM);
IoUtil.insertIntoInventory(container.getConnectedInventory(), extractedItems.getStacks(), Action.PERFORM);
IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.PERFORM);
next();
next();
listener.onSingleDone(this);
listener.onSingleDone(this);
container.onUsedForProcessing();
}
container.onUsedForProcessing();
}
}
}