diff --git a/changelog.txt b/changelog.txt index 6bb73fd..09d5ca2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 0.11.8 +Date: 2023-01-15 + Fixes: + - Add optional depenency on aai-industry to fix some mod load order discrepancies + Features: + - Support for Crafting Efficieny mod +--------------------------------------------------------------------------------------------------- Version: 0.11.7 Date: 2023-01-01 Changes: diff --git a/compatibility/crafting-efficiency.lua b/compatibility/crafting-efficiency.lua new file mode 100644 index 0000000..eb9c24b --- /dev/null +++ b/compatibility/crafting-efficiency.lua @@ -0,0 +1,32 @@ +local util = require("data-util"); + +if mods["crafting-efficiency-2"] then + + local recipes = util.me.recipes + local eff_data = { + -- ["synthetic-diamond"] = { + -- max = 15, + -- icon = data.raw.item["diamond"].icon, + -- crafting = { efficiency = 10 }, + -- research = { level = 6 }, + -- }, + } + + for i, recipe in pairs(recipes) do + -- add remaining recipes with direct items to find the icons + if data.raw.recipe[recipe] and data.raw.item[recipe] and not eff_data[recipe] then + eff_data[recipe] = { + name = recipe.." efficiency", + max = 15, + icon = data.raw.item[recipe].icon, + crafting = { efficiency = 10 }, + research = { level = 6 }, + } + end + end + for recipe, d in pairs(eff_data) do + log("Adding "..recipe.." crafting efficiency") + d.name = recipe:gsub("^%l", string.upper).." efficiency" + CE_Add_Recipe(d, recipe) + end +end diff --git a/data-updates.lua b/data-updates.lua index 1cf6951..1adcc14 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -2,6 +2,7 @@ require("recipe-updates") require("strange-matter") require("recipes/silicon-vulcanite") require("compatibility/248k") +require("compatibility/crafting-efficiency") if data.raw.resource["stone"] then if mods["space-exploration"] then diff --git a/info.json b/info.json index 8463ae6..f1a3a0b 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzsilicon", - "version": "0.11.7", + "version": "0.11.8", "factorio_version": "1.1", "title": "Silica & Silicon", "author": "Brevven", @@ -9,6 +9,7 @@ "dependencies": [ "? Krastorio2", "? 248k", + "? aai-industry", "? modmashsplinterelectronics", "(?) IndustrialRevolution", "base >= 0.18" diff --git a/me.lua b/me.lua index 0862458..0179a6f 100644 --- a/me.lua +++ b/me.lua @@ -1,6 +1,7 @@ local me = {} me.name = "bzsilicon" me.silicon_processing = mods["Krastorio2"] and "kr-silicon-processing" or "silicon-processing" +me.recipes = {"silica", "silicon", "optical-fiber", "silicon-wafer", "solar-cell", "gyro", "silicon-smelting-vulcanite"} function me.use_gyros() if me.get_setting("bz-all-intermediates") then return true end diff --git a/modules.lua b/modules.lua index d4019ff..a429457 100644 --- a/modules.lua +++ b/modules.lua @@ -1,19 +1,7 @@ local util = require("__bzsilicon__.data-util"); -recipes = {"silica", "silicon", "optical-fiber"} -if util.me.more_intermediates() then - table.insert(recipes, "silicon-wafer") - table.insert(recipes, "solar-cell") -end -if util.me.use_gyros() then - table.insert(recipes, "gyro") -end -if mods["space-exploration"] then - table.insert(recipes, "silicon-smelting-vulcanite") -end - -for i, recipe in pairs(recipes) do +for i, recipe in pairs(util.me.recipes) do if data.raw.recipe[recipe] then for j, module in pairs(data.raw.module) do if module.effect then