Thanks for pointing that out. That third line is unfortunate. Looks like some folks are discussing this exact issue on the forum too
I think bookkeeping which recipes (from any other mod) should be recycled to this level will be very fragile and frequently break, so relying on metadata is the way to go.
Since the metadata is being deleted by the quality mod, Here's what I'm going to change in my mods for the moment:
-- Save recycling metadata that is later removed by quality mod. Call near end of data.lua
function util.prepare_recycling_helper()
if mods.quality then
for _, recipe in pairs(data.raw.recipe) do
recipe.auto_recycle_helper = recipe.auto_recycle
end
end
end
-- Recalculate recycling recipes, call near end of data-updates.lua, after calling
-- util.prepare_recycling_helper from data.lua
function util.redo_recycling()
if mods.quality then
local recycling = require("__quality__.prototypes.recycling")
for _, recipe in pairs(data.raw.recipe) do
recipe.auto_recycle = recipe.auto_recycle_helper
recycling.generate_recycling_recipe(recipe)
recipe.auto_recycle = nil -- probably not necessary
end
end
end
Unfortunately, since quality clears the metadata in the data-update phase, it means that I can't fully handle this on my side if your mods depend on mine (or in the case of an "unlucky" mod load order when there are no explicit dependencies). For example, resin would still be broken in many cases. For your mods that depend on some of mine, you could either run a function similar util.prepare_recycling_helper()
or just explictly set auto_recycle_helper
alongside auto_recycle
.