remove add_titanium_ingredient
This commit is contained in:
parent
e108a78933
commit
20366198fb
4 changed files with 11 additions and 44 deletions
33
me.lua
33
me.lua
|
|
@ -16,10 +16,6 @@ else
|
|||
me.titanium_processing = "titanium-processing"
|
||||
end
|
||||
|
||||
function me.add_titanium_ingredient(amount, name)
|
||||
add_ingredient(name, me.titanium_plate, amount)
|
||||
end
|
||||
|
||||
function me.get_setting(name)
|
||||
if settings.startup[name] == nil then
|
||||
return nil
|
||||
|
|
@ -39,33 +35,4 @@ if me.get_setting(me.name.."-recipe-bypass") then
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- TODO These helpers are all duplicates, remove them
|
||||
--
|
||||
|
||||
function add_ingredient(recipe_name, ingredient, quantity)
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
xadd_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
xadd_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
|
||||
xadd_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
|
||||
end
|
||||
end
|
||||
|
||||
function xadd_ingredient(recipe, ingredient, quantity)
|
||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||
for i, existing in pairs(recipe.ingredients) do
|
||||
if existing[1] == ingredient or existing.name == ingredient then
|
||||
log("Not adding "..ingredient.." -- duplicate")
|
||||
return
|
||||
end
|
||||
end
|
||||
table.insert(recipe.ingredients, {ingredient, quantity})
|
||||
end
|
||||
end
|
||||
--
|
||||
-- End duplicates
|
||||
--
|
||||
|
||||
return me
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue