From 8710b56d90ee9a661e55256ababf780d2798e811 Mon Sep 17 00:00:00 2001 From: Brevven Date: Sat, 24 Sep 2022 20:48:00 -0700 Subject: [PATCH] minor refactor --- carbon-recipe-final-k2.lua | 19 +++++++++---------- carbon-recipe-final-se.lua | 7 +++---- info.json | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/carbon-recipe-final-k2.lua b/carbon-recipe-final-k2.lua index 973edf8..fa9f118 100644 --- a/carbon-recipe-final-k2.lua +++ b/carbon-recipe-final-k2.lua @@ -1,7 +1,7 @@ -local bzutil = require("data-util"); -local util = require("util") +local util = require("data-util"); +local futil = require("util") if mods.Krastorio2 then - if bzutil.me.use_fullerenes() then + if util.me.use_fullerenes() then -- Add extra nanotube recipes. -- This could be moved to data-updates in future if necessary data:extend({ @@ -19,7 +19,7 @@ if mods.Krastorio2 then energy_required = 32, ingredients = { {"nanotubes", 6}, - table.unpack(util.table.deepcopy(data.raw.recipe["imersium-plate"].ingredients)), + table.unpack(futil.table.deepcopy(data.raw.recipe["imersium-plate"].ingredients)), }, result = "imersium-plate", result_count = 6, @@ -39,7 +39,7 @@ if mods.Krastorio2 then energy_required = 12, ingredients = { {"nanotubes", 4}, - table.unpack(util.table.deepcopy(data.raw.recipe["kr-s-c-imersium-beam"].ingredients)), + table.unpack(futil.table.deepcopy(data.raw.recipe["kr-s-c-imersium-beam"].ingredients)), }, result = "imersium-beam", result_count = 2, @@ -59,15 +59,14 @@ if mods.Krastorio2 then energy_required = 12, ingredients = { {"nanotubes", 2}, - table.unpack(util.table.deepcopy(data.raw.recipe["kr-s-c-imersium-gear-wheel"].ingredients)), + table.unpack(futil.table.deepcopy(data.raw.recipe["kr-s-c-imersium-gear-wheel"].ingredients)), }, result = "imersium-gear-wheel", result_count = 2, }, }) - - bzutil.add_effect("nanotubes", {type="unlock-recipe", recipe="imersium-plate-nanotubes"}) - bzutil.add_effect("nanotubes", {type="unlock-recipe", recipe="imersium-beam-nanotubes"}) - bzutil.add_effect("nanotubes", {type="unlock-recipe", recipe="imersium-gear-wheel-nanotubes"}) + util.add_unlock("nanotubes", "imersium-plate-nanotubes") + util.add_unlock("nanotubes", "imersium-beam-nanotubes") + util.add_unlock("nanotubes", "imersium-gear-wheel-nanotubes") end end diff --git a/carbon-recipe-final-se.lua b/carbon-recipe-final-se.lua index 17c2535..23b09bf 100644 --- a/carbon-recipe-final-se.lua +++ b/carbon-recipe-final-se.lua @@ -1,5 +1,5 @@ -local futil = require("util") local util = require("data-util"); +local futil = require("util") if mods["space-exploration"] then -- core mining balancing graphite at full, diamond removed @@ -28,7 +28,7 @@ if mods["space-exploration"] then result_count = 2, }, }) - util.add_effect("se-aeroframe-scaffold", {type="unlock-recipe", recipe="aeroframe-scaffold-nanotubes"}) + util.add_unlock("se-aeroframe-scaffold", "aeroframe-scaffold-nanotubes") data:extend({ { @@ -53,7 +53,6 @@ if mods["space-exploration"] then } }) util.add_to_product("nanomaterial-nanotubes", "se-nanomaterial", 16) - util.add_effect("se-nanomaterial", {type="unlock-recipe", recipe="nanomaterial-nanotubes"}) - + util.add_unlock("se-nanomaterial", "nanomaterial-nanotubes") end end diff --git a/info.json b/info.json index 930edfc..558ccb6 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzcarbon", - "version": "0.4.6", + "version": "0.4.7", "factorio_version": "1.1", "title": "Graphite & Diamonds", "author": "Brevven",