Fixed an autocrafting crash, fixes #1567

This commit is contained in:
raoulvdberge
2018-03-08 21:38:47 +01:00
parent 0b9c62c6c0
commit 333935bd85
2 changed files with 11 additions and 6 deletions

View File

@@ -249,15 +249,19 @@ public class CraftingTask implements ICraftingTask {
toCraft.add(inputCrafted);
actualInputs.add(inputCrafted);
previousSteps.add(calculate(networkItems, networkFluids, inputPattern, toInsert));
ICraftingStep step = calculate(networkItems, networkFluids, inputPattern, toInsert);
input.shrink(craftQuantity);
if (recursedPattern == null) {
// Calculate added all the crafted outputs toInsert
// So we remove the ones we use from toInsert
ItemStack inserted = toInsert.get(inputCrafted, compare);
toInsert.remove(inserted, craftQuantity);
if (step != null) {
previousSteps.add(step);
if (recursedPattern == null) {
// Calculate added all the crafted outputs toInsert
// So we remove the ones we use from toInsert
ItemStack inserted = toInsert.get(inputCrafted, compare);
toInsert.remove(inserted, craftQuantity);
}
}
} else {
// Fluid checks are with a stack size of one