This commit is contained in:
Brevven 2023-01-16 22:49:44 -08:00
parent 3866132e3e
commit e60dd5dfb1
2 changed files with 10 additions and 10 deletions

View file

@ -1,6 +1,6 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 0.1.9 Version: 0.1.9
Date: 2022-01-17 Date: 2023-01-17
Features: Features:
- (Beta) Crafting efficiency compatibility - (Beta) Crafting efficiency compatibility
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------

View file

@ -10,15 +10,15 @@ if mods["crafting-efficiency-2"] then
if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe]) if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe])
and not eff_data[recipe] then and not eff_data[recipe] then
local research_level = 1 local research_level = 1
if not data.raw.recipe[recipe].enabled then if not data.raw.recipe[recipe].enabled then
for tech, tbl in pairs(data.raw.technology) do for tech, tbl in pairs(data.raw.technology) do
for _, effect in pairs(tbl.effects or {}) do for _, effect in pairs(tbl.effects or {}) do
if effect.type == "unlock-recipe" and effect.recipe == recipe then if effect.type == "unlock-recipe" and effect.recipe == recipe then
research_level = math.min(#tbl.unit.ingredients, 6) research_level = math.min(#tbl.unit.ingredients, 6)
end end
end end
end end
end end
eff_data[recipe] = { eff_data[recipe] = {
max = 15, max = 15,
icon = util.get_item_or_fluid_icon(recipe), icon = util.get_item_or_fluid_icon(recipe),