DarkPacks/SevTweaks

Simplify addIngredients

justinrusso opened this issue · 0 comments

if (ingredient == null) {
CraftTweakerAPI.logError(String.format("[Stage %s] Ingredient can not be null!", this.getStage()));
continue;
}
if (stagedIngredients.containsKey(ingredient)) {
CraftTweakerAPI.logError(String.format("[Stage %s] Failed to add the ingredient `%s` due to already being added.", this.getStage(), ingredient.toString()));
continue;
}
stagedIngredients.put(ingredient, new StagedIngredient(ingredient, recipeStage));

This can be simplified to addIngredient(ingredient, recipeStage);