diff --git a/carbon-recipe-modules.lua b/carbon-recipe-modules.lua index 8be6a88..cde8d58 100644 --- a/carbon-recipe-modules.lua +++ b/carbon-recipe-modules.lua @@ -1,20 +1,7 @@ -- Enable prod modules for all recipes local util = require("data-util"); -recipes = { - "graphite", - "synthetic-diamond", - - "graphene", - "heavy-water-graphene", - "enriched-graphite", - - "fullerenes", - "nanotubes", - - "diamond-synthesis-vulcanite", - -- NOTE: Carbon black recipes do not allow prod modules -} +local recipes = util.me.recipes -- Add all *-nanotubes recipes that exist local ending = "-nanotubes" diff --git a/changelog.txt b/changelog.txt index 7e916de..a085077 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 0.5.6 +Date: 2022-12-28 + Features: + - Support for Crafting Efficieny mod (note: technology icon cropping issues) + Changes: + - Carbon fiber, polyacrylonitrile, and rough diamond processing can benefit from productivity +--------------------------------------------------------------------------------------------------- Version: 0.5.5 Date: 2022-12-28 Changes: diff --git a/compatibility/crafting-efficiency.lua b/compatibility/crafting-efficiency.lua new file mode 100644 index 0000000..e844c62 --- /dev/null +++ b/compatibility/crafting-efficiency.lua @@ -0,0 +1,38 @@ +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 }, + }, + ["diamond-processing"] = { + 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 7815879..4d8cdb9 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -21,5 +21,6 @@ if mods.Asteroid_Mining then end end +require("compatibility/crafting-efficiency") -- Must be last util.create_list() diff --git a/info.json b/info.json index 281ef84..8bbff75 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzcarbon", - "version": "0.5.5", + "version": "0.5.6", "factorio_version": "1.1", "title": "Graphite & Diamonds", "author": "Brevven", diff --git a/me.lua b/me.lua index 2a137d0..528de5b 100644 --- a/me.lua +++ b/me.lua @@ -3,6 +3,25 @@ local me = {} me.name = "bzcarbon" me.list = {} +me.recipes = { -- recipes that allow productivity + "graphite", + "synthetic-diamond", + "diamond-processing", + + "graphene", + "heavy-water-graphene", + "enriched-graphite", + + "fullerenes", + "nanotubes", + + "carbon-fiber", + "polyacrylonitrile", + + "diamond-synthesis-vulcanite", + -- NOTE: Carbon black recipes do not allow prod modules +} + function me.use_fiber() return me.get_setting("bzcarbon-enable-carbon-fiber") == "yes" end