Code: Select all
function ReplaceAllIngredientFluidWithFluid(Fluid1 , Fluid2)
for i, recipe in pairs(data.raw.recipe) do
for v, ingredient in pairs(data.raw.recipe[recipe.name].ingredients) do
if ingredient.type == "fluid" then
if ingredient.name == Fluid1 then
ingredient.type = "fluid"
ingredient.name = Fluid2
end
end
end
end
end
Code: Select all
function ReplaceAllIngredientItemWithItem(Item1 , Item2)
for i, recipe in pairs(data.raw.recipe) do
for v, ingredient in pairs(data.raw.recipe[recipe.name].ingredients) do
if ingredient.type == "item" then
if ingredient.name == Item1 then
ingredient.name = Item2
ingredient.amount = ingredient.amount
end
end
end
end