Skip to content

Commit

Permalink
Check for disabled brewing recipes using a BrewingRecipeRegistry#hasO…
Browse files Browse the repository at this point in the history
…utput (#1065)
  • Loading branch information
kindlich authored and mezz committed Dec 5, 2017
1 parent de7f7c9 commit 570f499
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -29,6 +29,7 @@
public class BrewingRecipeMaker {

private final Set<Class> unhandledRecipeClasses = new HashSet<>();
private final Set<BrewingRecipeWrapper> disabledRecipes = new HashSet<>();
private final IIngredientRegistry ingredientRegistry;

public static List<BrewingRecipeWrapper> getBrewingRecipes(IIngredientRegistry ingredientRegistry) {
Expand Down Expand Up @@ -92,8 +93,12 @@ private List<ItemStack> getNewPotions(List<ItemStack> knownPotions, List<ItemSta
}

BrewingRecipeWrapper recipe = new BrewingRecipeWrapper(Collections.singletonList(potionIngredient), potionInput.copy(), potionOutput);
if (!recipes.contains(recipe)) {
recipes.add(recipe);
if (!recipes.contains(recipe) && !disabledRecipes.contains(recipe)) {
if (BrewingRecipeRegistry.hasOutput(potionInput, potionIngredient)) {
recipes.add(recipe);
} else {
disabledRecipes.add(recipe);
}
newPotions.add(potionOutput);
}
}
Expand Down

0 comments on commit 570f499

Please sign in to comment.