This commit is contained in:
Brevven 2023-02-03 23:54:05 -08:00
parent 5db52eb57f
commit 685ba10082

View file

@ -546,6 +546,21 @@ function util.get_amount(recipe_name, product)
return 0
end
-- Get the count of results
function util.get_result_count(recipe_name, product)
if not product then product = recipe_name end
local recipe = data.raw.recipe[recipe_name]
if recipe then
if recipe.normal and recipe.normal.results then
return #(recipe.normal.results)
elseif recipe.results then
return #(recipe.results)
end
return 1
end
return 0
end
-- Replace one ingredient with another in a recipe
-- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true.
function util.replace_ingredient(recipe_name, old, new, amount, multiply, options)