check if step has started before anything else

This commit is contained in:
way2muchnoise
2017-01-10 20:19:18 +01:00
parent 6120d32979
commit 41daeb0ce4

View File

@@ -370,20 +370,22 @@ public class CraftingTask implements ICraftingTask {
}
for (ICraftingStep step : leafSteps) {
ICraftingPatternContainer container = step.getPattern().getContainer();
Integer timesUsed = usedContainers.get(container);
if (!step.hasStartedProcessing()) {
ICraftingPatternContainer container = step.getPattern().getContainer();
Integer timesUsed = usedContainers.get(container);
if (timesUsed == null) {
timesUsed = 0;
}
if (timesUsed == null) {
timesUsed = 0;
}
if (timesUsed++ <= container.getSpeedUpdateCount()) {
if (!step.getPattern().isProcessing() || !container.isBlocked()) {
if (!step.hasStartedProcessing() && step.canStartProcessing(oreDictPrepped, networkFluids)) {
step.setStartedProcessing();
step.execute(toInsertItems, toInsertFluids);
usedContainers.put(container, timesUsed);
network.markCraftingMonitorForUpdate();
if (timesUsed++ <= container.getSpeedUpdateCount()) {
if (!step.getPattern().isProcessing() || !container.isBlocked()) {
if (step.canStartProcessing(oreDictPrepped, networkFluids)){
step.setStartedProcessing();
step.execute(toInsertItems, toInsertFluids);
usedContainers.put(container, timesUsed);
network.markCraftingMonitorForUpdate();
}
}
}
}