fix loading of crafting tasks

This commit is contained in:
way2muchnoise
2017-02-03 16:29:33 +01:00
parent 530fa7acac
commit a1683068b1
2 changed files with 4 additions and 1 deletions

View File

@@ -274,6 +274,9 @@ public class CraftingManager implements ICraftingManager {
patterns.addAll((((ICraftingPatternContainer) node).getPatterns())); patterns.addAll((((ICraftingPatternContainer) node).getPatterns()));
} }
} }
// Auto reschedules stuck tasks after a pattern rebuild
craftingTasks.forEach(t -> t.getMissing().clear());
} }
private static ICraftingTask readCraftingTask(INetworkMaster network, NBTTagCompound tag) { private static ICraftingTask readCraftingTask(INetworkMaster network, NBTTagCompound tag) {

View File

@@ -433,7 +433,7 @@ public class CraftingTask implements ICraftingTask {
@Override @Override
public void reschedule() { public void reschedule() {
List<ICraftingStep> mainSteps = this.mainSteps.stream().filter(s -> s.getPattern() == pattern).collect(Collectors.toList()); List<ICraftingStep> mainSteps = this.mainSteps.stream().filter(s -> s.getPattern().alike(pattern)).collect(Collectors.toList());
missing.clear(); missing.clear();
this.mainSteps.clear(); this.mainSteps.clear();
// if the list of main mainSteps is empty there is no point in rescheduling // if the list of main mainSteps is empty there is no point in rescheduling