diff --git a/src/api/java/blusunrize/immersiveengineering/api/crafting/BlueprintCraftingRecipe.java b/src/api/java/blusunrize/immersiveengineering/api/crafting/BlueprintCraftingRecipe.java index 64518134d8..8f80f8b613 100644 --- a/src/api/java/blusunrize/immersiveengineering/api/crafting/BlueprintCraftingRecipe.java +++ b/src/api/java/blusunrize/immersiveengineering/api/crafting/BlueprintCraftingRecipe.java @@ -127,32 +127,25 @@ else if(maxCrafted.isPresent()) public NonNullList consumeInputs(NonNullList query, int crafted) { NonNullList consumed = NonNullList.create(); - Iterator inputIt = inputs.iterator(); - while(inputIt.hasNext()) + for(IngredientWithSize ingr : inputs) { - IngredientWithSize ingr = inputIt.next(); int inputSize = ingr.getCount()*crafted; for(int i = 0; i < query.size(); i++) { ItemStack queryStack = query.get(i); - if(!queryStack.isEmpty()) - if(ingr.test(queryStack)) - { - int taken = Math.min(queryStack.getCount(), inputSize); - consumed.add(ItemHandlerHelper.copyStackWithSize(queryStack, taken)); - if(taken >= queryStack.getCount()&&queryStack.getItem().hasCraftingRemainingItem(queryStack)) - query.set(i, queryStack.getItem().getCraftingRemainingItem(queryStack)); - else - queryStack.shrink(taken); - inputSize -= taken; - if(inputSize <= 0) - { - inputIt.remove(); - break; - } - } - + if(!queryStack.isEmpty()&&ingr.test(queryStack)) + { + int taken = Math.min(queryStack.getCount(), inputSize); + consumed.add(ItemHandlerHelper.copyStackWithSize(queryStack, taken)); + if(taken >= queryStack.getCount()&&queryStack.getItem().hasCraftingRemainingItem(queryStack)) + query.set(i, queryStack.getItem().getCraftingRemainingItem(queryStack)); + else + queryStack.shrink(taken); + inputSize -= taken; + if(inputSize <= 0) + break; + } } } return consumed;