Basic usage
Just add "~ ZZZ-RecyclerFinalFinal" to your dependencies in info.json. If your mod is pretty minimal that's all you need to do, but most mods have greater ambitions than that.
Intermediate usage
The vanilla Quality mod behavior is to iterate over all recipes and generate recycling recipes based on every recipe in the game matching certain criteria. This creates ambiguity if, for example, there are two recipes for an item that pass those criteria.
RFF instead iterates over all items and determines their canonical recipe. This is determined like so:
- if the item prototype has the canonical_recipe set to a value, it will go with that value without any further checks. You can set this to the name of a recipe, or to true or false which have special effects.
- if there is a recipe with an identical name to the item that produces the item without byproducts, that recipe will be used.
- if there is exactly one recipe that produces the item without byproducts, that recipe will be used. (This requires iterating over all recipes, which is why the identical name takes precedence.)
If no canonical recipe is found, or the canonical recipe is not valid for recycling, a recycle-into-self recipe will be generated.
Setting canonical_recipe to true will force the item to recycle into itself.
Setting canonical_recipe to false will prevent the creation of a recycling recipe for that item altogether.
"Valid for recycling" means the recipe produces exactly one type of item and is of a recipe category that is allowed for recycling.
Advanced usage
You can set can_recycle = false on recipe-categories to make RFF treat them as not valid for recycling. This will NOT affect the behavior of Quality's recipe generation in data-updates, which mods have no control over.
RFF deletes all recipes with the category "recycling" before generating new ones. Recipes with bespoke = true will not be deleted and will not be overriden by a generated recipe. This is useful for any custom recycling recipe like scrap. Note that Quality does NOT respect bespoke - if there is another recipe that produces the item that the bespoke recipe consumes, you may have to set auto_recyle = false on that recipe to ensure Quality does not override the bespoke recipe with an auto-generated one.
RFF respects auto_recycle = false, as well as auto_recycle_bypass = false, which it treats as the same. All recipes with auto_recycle set when this mod's data.lua runs will also have auto_recycle_bypass set, to ensure this information survives past data-updates.
You can also set force_auto_recycle = true on a recipe, which overrides its category having can_recycle = false.
The rules for which items are recyclable that are normally hardcoded into Quality (e.g. chemistry is not recyclable, with an exception for batteries) have been converted into this paradigm, so you can edit them in data-updates and data-final-fixes.