The current version of Factorio's documentation does not document the "auto_recycle" recipe-prototype feature, which appears to control if a recipe is reversible via recyclers. Without documentation for this feature, modders will not know how to mark recipes as irreversible.
https://lua-api.factorio.com/latest/pro ... otype.html
This is an example of "auto_recycle" within Space Age's source code, in the recipe for carbon fiber.
Code: Select all
type = "recipe",
name = "carbon-fiber",
category = "organic",
subgroup = "agriculture-products",
order = "a[organic-products]-h[carbon-fiber]",
auto_recycle = false,
energy_required = 5,
enabled = false,
ingredients =
{
{type = "item", name = "yumako-mash", amount = 10},
{type = "item", name = "carbon", amount = 1}
},
results = {{type="item", name="carbon-fiber", amount=1}},
allow_productivity = true,
crafting_machine_tint =
{
primary = {r = 0.306, g = 0.643, b = 0.684, a = 1.000},
secondary = {r = 0.684, g = 0.684, b = 0.684, a = 1.000},
},
},
Code: Select all
local default_can_recycle = function(recipe)
if recipe.category == "recycling" then return end
-- Allow recipes to opt-out
if recipe.auto_recycle == false then return end
-- Disallow smelting and chemistry recipes
if recipe.subgroup == "empty-barrel" then return end
if recipe.category == "smelting" then return end
if recipe.category == "chemistry" then return end
if recipe.category == "chemistry-or-cryogenics" and recipe.name ~= "battery" then return end
if recipe.category == "crushing" then return end
local recycling_metallurgy = {["big-mining-drill"]=true, ["turbo-transport-belt"]=true, ["turbo-underground-belt"]=true, ["turbo-splitter"]=true}
if recipe.category == "metallurgy" and recycling_metallurgy[recipe.name] == nil then return end
if recipe.category == "organic" then return end
if recipe.category == "cryogenics" and recipe.name ~= "railgun-turret" and recipe.name ~= "railgun" and recipe.name ~= "cryogenic-plant" and recipe.name ~= "fusion-reactor" and recipe.name ~= "fusion-generator" then return end
if string.find(recipe.name, "science") and string.find(recipe.name, "pack") then return end
-- Items which go into T3 modules recycle into themselves
if recipe.name == "tungsten-carbide" then return end
if recipe.name == "superconductor" then return end
if recipe.name == "biolab" then return end
return true
end
Code: Select all
for name, recipe in pairs(data.raw.recipe) do
recycling.generate_recycling_recipe(recipe)
recipe.auto_recycle = nil
end