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:
@@ -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,21 +146,19 @@ 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);
|
||||||
extractedFluids = IoUtil.extractFromInternalFluidStorage(requirements.getSingleFluidRequirementSet(false), internalFluidStorage, Action.PERFORM);
|
extractedFluids = IoUtil.extractFromInternalFluidStorage(requirements.getSingleFluidRequirementSet(false), internalFluidStorage, Action.PERFORM);
|
||||||
|
|
||||||
IoUtil.insertIntoInventory(container.getConnectedInventory(), extractedItems.getStacks(), Action.PERFORM);
|
IoUtil.insertIntoInventory(container.getConnectedInventory(), extractedItems.getStacks(), Action.PERFORM);
|
||||||
IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.PERFORM);
|
IoUtil.insertIntoInventory(container.getConnectedFluidInventory(), extractedFluids.getStacks(), Action.PERFORM);
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|
||||||
listener.onSingleDone(this);
|
listener.onSingleDone(this);
|
||||||
|
|
||||||
container.onUsedForProcessing();
|
container.onUsedForProcessing();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user