diff --git a/compatibility/crafting-efficiency.lua b/compatibility/crafting-efficiency.lua index 62dc93d..ea5a48c 100644 --- a/compatibility/crafting-efficiency.lua +++ b/compatibility/crafting-efficiency.lua @@ -8,16 +8,22 @@ if mods["crafting-efficiency-2"] then for i, recipe in pairs(util.me.recipes) do -- add remaining recipes with direct items to find the icons if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe]) - and not eff_data[recipe] and - recipe ~= "alumina" and -- for some reason this does not work, despite having a main_product - recipe ~= "phenol" and -- for some reason this does not work, despite having a main_product - "enriched-" ~= string.sub(recipe, 1, string.len("enriched-")) and - (data.raw.recipe[recipe].main_product or util.get_result_count(recipe) == 1) then + and not eff_data[recipe] then + local research_level = 1 + if not data.raw.recipe[recipe].enabled then + for tech, tbl in pairs(data.raw.technology) do + for _, effect in pairs(tbl.effects or {}) do + if effect.type == "unlock-recipe" and effect.recipe == recipe then + research_level = math.min(#tbl.unit.ingredients, 6) + end + end + end + end eff_data[recipe] = { max = 15, icon = util.get_item_or_fluid_icon(recipe), crafting = { efficiency = 10 }, - research = { level = 6 }, + research = { level = research_level }, } end end diff --git a/tungsten-enriched.lua b/tungsten-enriched.lua index e68c149..2c628e1 100644 --- a/tungsten-enriched.lua +++ b/tungsten-enriched.lua @@ -30,6 +30,7 @@ data:extend({ always_show_made_in = true, always_show_products = true, allow_productivity = true, + subgroup = "raw-material", ingredients = { {type = "fluid", name = "ammonia", amount = 10},