Barreling Machine

by fride02

Adds a 1x1 machine to barrel and unbarrel fluids.

Content
1 year, 2 months ago
1.1
717
Logistics Fluids

g Stop working if hide barreling recipes is checked

1 year, 21 days ago

Stop working if hide barreling recipes is checked

1 year, 21 days ago
(updated 1 year, 21 days ago)

Fixed for you. You need to create new recipes instead of modifying existing.

In data-final-fixes:

++local new_recipes = {}
for _, recipe in pairs(data.raw["recipe"]) do
if (recipe.subgroup=="fill-barrel" or recipe.subgroup=="hp-fill-barrel") then
++ -- add new recipe
++ local new_recipe = util.table.deepcopy(data.raw["recipe"][recipe.name])
++ new_recipe.name = recipe.name.."-barreling-machine"
++ new_recipe.category = "fill-barrel"
++ new_recipe.hidden = true
++ new_recipe.enabled = true
++ table.insert(new_recipes, new_recipe)
++ -- hide existing recipe
if (settings.startup["fr-hide-barrel-recipes"].value == true) then
-- (line removed)
data.raw["recipe"][recipe.name].hidden = true
data.raw["recipe"][recipe.name].enabled = true
recipe_index[recipe.name] = true
end
end
if (recipe.subgroup=="empty-barrel" or recipe.subgroup=="hp-empty-barrel") then
++ -- add new recipe
++ local new_recipe = util.table.deepcopy(data.raw["recipe"][recipe.name])
++ new_recipe.name = recipe.name.."-barreling-machine"
++ new_recipe.category = "empty-barrel"
++ new_recipe.hidden = true
++ new_recipe.enabled = true
++ table.insert(new_recipes, new_recipe) -----------------------------------this
++ -- hide existing recipe
if (settings.startup["fr-hide-barrel-recipes"].value == true) then
-- (line removed)
data.raw["recipe"][recipe.name].hidden = true
data.raw["recipe"][recipe.name].enabled = true
recipe_index[recipe.name] = true
end
end
end

++data:extend(new_recipes)

5 months ago

@popner Is this supposed to be in place of the code in In data-final-fixes, or in addition too?

New response