diff --git a/src/main/java/gregtech/api/capability/impl/AbstractRecipeLogic.java b/src/main/java/gregtech/api/capability/impl/AbstractRecipeLogic.java index 08a1efb59a..c85045228f 100755 --- a/src/main/java/gregtech/api/capability/impl/AbstractRecipeLogic.java +++ b/src/main/java/gregtech/api/capability/impl/AbstractRecipeLogic.java @@ -195,15 +195,11 @@ protected void trySearchNewRecipe() { else { currentRecipe = findRecipe(maxVoltage, importInventory, importFluids); } - // If a recipe was found, then inputs were valid. + // If a recipe was found, then inputs were valid. Cache found recipe. if (currentRecipe != null) { - this.invalidInputsForRecipes = false; this.previousRecipe = currentRecipe; - // Add-ons may Override findRecipe method but not trySearchNewRecipe, in that case - // they may return a null recipe. Since we only check for items and fluid here, having - // findRecipe return a null recipe with isOutputsFull being true, means we have a valid - // recipe in the input waiting for space in the output. - } else this.invalidInputsForRecipes = !this.isOutputsFull; + } + this.invalidInputsForRecipes = (currentRecipe == null); // proceed if we have a usable recipe. if (currentRecipe != null && setupAndConsumeRecipeInputs(currentRecipe)) diff --git a/src/main/java/gregtech/common/metatileentities/multi/electric/MetaTileEntityMultiFurnace.java b/src/main/java/gregtech/common/metatileentities/multi/electric/MetaTileEntityMultiFurnace.java index c414d6fa2c..1651bc56c4 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/electric/MetaTileEntityMultiFurnace.java +++ b/src/main/java/gregtech/common/metatileentities/multi/electric/MetaTileEntityMultiFurnace.java @@ -142,7 +142,9 @@ protected Recipe findRecipe(long maxVoltage, /* Iterate over the input items looking for more things to add until we run either out of input items * or we have exceeded the number of items permissible from the smelting bonus */ - this.invalidInputsForRecipes = true; + boolean matchedRecipe = false; + boolean canFitOutputs = true; + for(int index = 0; index < inputs.getSlots() && currentItemsEngaged < maxItemsLimit; index++) { // Skip this slot if it is empty. @@ -157,7 +159,7 @@ protected Recipe findRecipe(long maxVoltage, CountableIngredient inputIngredient; if(matchingRecipe != null) { inputIngredient = matchingRecipe.getInputs().get(0); - this.invalidInputsForRecipes = false; + matchedRecipe = true; } else continue; @@ -185,7 +187,7 @@ protected Recipe findRecipe(long maxVoltage, computeOutputItemStacks(temp, matchingRecipe.getOutputs().get(0), recipeMultiplier); // determine if there is enough room in the output to fit all of this - boolean canFitOutputs = InventoryUtils.simulateItemStackMerge(temp, this.getOutputInventory()); + canFitOutputs = InventoryUtils.simulateItemStackMerge(temp, this.getOutputInventory()); // if there isn't, we can't process this recipe. if(!canFitOutputs) @@ -203,13 +205,10 @@ protected Recipe findRecipe(long maxVoltage, } } - // If there were no accepted ingredients, then there is no recipe to process. - // the output may be filled up - if (recipeInputs.isEmpty() && !invalidInputsForRecipes) { - //Set here to prevent recipe deadlock on world load with full output bus - this.isOutputsFull = true; - return null; - } else if (recipeInputs.isEmpty()) { + this.invalidInputsForRecipes = !matchedRecipe; + this.isOutputsFull = !canFitOutputs; + + if (recipeInputs.isEmpty()) { return null; }