From 29eed595fa220748dff2bcdc46eaaf023cdf82a7 Mon Sep 17 00:00:00 2001 From: pla Date: Sat, 1 Nov 2025 12:41:07 +0100 Subject: [PATCH 1/2] Make bz* and bz*2 compatible (#1) If you accept the PR, don't forget to add the bz* mods to the info.json Co-authored-by: pla Reviewed-on: https://git.cacklingfiend.info/cacklingfiend/Indium2/pulls/1 Co-authored-by: pla Co-committed-by: pla --- Indium2/data-util.lua | 14 ++++++++++++++ Indium2/info.json | 5 +++++ Indium2/prototypes/indium-recipe.lua | 19 ++++++++++--------- Indium2/prototypes/technology.lua | 4 ++-- Indium2/recipe-modify.lua | 4 ++-- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Indium2/data-util.lua b/Indium2/data-util.lua index f1e0b76..52c9094 100644 --- a/Indium2/data-util.lua +++ b/Indium2/data-util.lua @@ -1,5 +1,19 @@ local util = {} +util.bz = {} +util.bz.carbon = mods["bzcarbon"] and "bzcarbon" or mods["bzcarbon2"] and "bzcarbon2" +util.bz.lead = mods["bzlead"] and "bzlead" or mods["bzlead2"] and "bzlead2" +util.bz.silicon = mods["bzsilicon"] and "bzsilicon" or mods["bzsilicon2"] and "bzsilicon2" +util.bz.tin = mods["bztin"] and "bztin" or mods["bztin2"] and "bztin2" +util.bz.titanium = mods["bztitanium"] and "bztitanium" or mods["bztitanium2"] and "bztitanium2" +util.bz.zirconium = mods["bzzirconium"] and "bzzirconium" or mods["bzzirconium2"] and "bzzirconium2" +util.bz.gold = mods["bzgold"] and "bzgold" or mods["bzgold2"] and "bzgold2" +util.bz.aluminum = mods["bzaluminum"] and "bzaluminum" or mods["bzaluminum2"] and "bzaluminum2" +util.bz.gas = mods["bzgas"] and "bzgas" or mods["bzgas2"] and "bzgas2" +util.bz.chlorine = mods["bzchlorine"] and "bzchlorine" or mods["bzchlorine2"] and "bzchlorine2" +util.bz.tungsten = mods["bztungsten"] and "bztungsten" or mods["bztungsten2"] and "bztungsten2" +util.bz.foundry = mods["bzfoundry"] and "bzfoundry" or mods["bzfoundry2"] and "bzfoundry2" + -- se landfill -- params: ore, icon_size function util.se_landfill(params) diff --git a/Indium2/info.json b/Indium2/info.json index 117fd76..74d7857 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -10,10 +10,15 @@ "base >= 2.0.0", "? bismuth", "? BrassTacks-Updated", + "? bzcarbon", "? bzcarbon2", + "? bzfoundry", "? bzfoundry2", + "? bzlead", "? bzlead2", + "? bzsilicon", "? bzsilicon2", + "? bztin", "? bztin2", "? IfNickel-Updated", "? Krastorio2", diff --git a/Indium2/prototypes/indium-recipe.lua b/Indium2/prototypes/indium-recipe.lua index 412478e..82c255f 100644 --- a/Indium2/prototypes/indium-recipe.lua +++ b/Indium2/prototypes/indium-recipe.lua @@ -40,12 +40,12 @@ data:extend({ }) local solder_ingredients = {{type="item", name="indium-plate", amount=6}} -if mods["bzlead2"] then +if util.bz.lead then solder_ingredients = {{type="item", name="indium-plate", amount=3}, {type="item", name="lead-plate", amount=3}} end local solder_category = "crafting" local solder_subgroup = "intermediate-product" -if mods["bzfoundry2"] then +if util.bz.foundry then solder_category = "founding" solder_subgroup = "foundry-intermediate" end @@ -94,18 +94,19 @@ data:extend({ } }) -if mods["bzsilicon2"] and data.raw.item["solar-cell"] then +if util.bz.silicon and data.raw.item["solar-cell"] then local solar_cell_ingredients = {{type="item", name="copper-plate", amount=1}, {type="item", name="indium-plate", amount=1}, {type="item", name="electronic-circuit", amount=2}} if mods["Krastorio2"] then table.insert(solar_cell_ingredients, {type="item", name="kr-rare-metals", amount=1}) end + data:extend({ { type = "recipe", name = "indium-solar-cell", icons = { - { icon = "__bzsilicon2__/graphics/icons/solar-cell.png", icon_size = 64 }, + { icon = "__" .. util.bz.silicon .. "__/graphics/icons/solar-cell.png", icon_size = 64 }, { icon = "__Indium2__/graphics/icons/indium-plate.png", icon_size = 64, scale=0.2, shift= {-8, -8}}, }, category = "advanced-crafting", @@ -121,22 +122,22 @@ if mods["bzsilicon2"] and data.raw.item["solar-cell"] then end local solder_pcb_ingredients = {{type="item", name="indium-plate", amount=10}} -if mods["bztin2"] then +if util.bz.tin then solder_pcb_ingredients = {{type="item", name="indium-plate", amount=6}, {type="item", name="tin-plate", amount=5}} end local solder_pcb_category = "crafting" local solder_pcb_subgroup = "intermediate-product" -if mods["bzfoundry2"] then +if util.bz.foundry then solder_pcb_category = "founding" solder_pcb_subgroup = "foundry-intermediate" end -if mods["bismuth"] and mods["bztin2"] then +if mods["bismuth"] and util.bz.tin then data:extend({ { type = "recipe", name = "indium-pcb-solder", icons = { - { icon = "__bztin2__/graphics/icons/solder.png", icon_size = 128, tint = {r = 0.7, g = 0.5, b = 0.9, a = 1} }, + { icon = "__" .. util.bz.tin .. "__/graphics/icons/solder.png", icon_size = 128, tint = {r = 0.7, g = 0.5, b = 0.9, a = 1} }, { icon = "__Indium2__/graphics/icons/indium-plate.png", icon_size = 64, scale=0.2, shift= {-8, -8}}, }, group = "intermediate-products", @@ -166,7 +167,7 @@ if mods["BrassTacks-Updated"] and data.raw.item["airtight-seal"]then order = "c", enabled = false, energy_required = 5, - ingredients = {{type="item", name="bolted-flange", amount=1}, mods["bzcarbon2"] and {type="item", name="graphite", amount=4}, {type="item", name="indium-solder", amount=2}}, + ingredients = {{type="item", name="bolted-flange", amount=1}, util.bz.carbon and {type="item", name="graphite", amount=4}, {type="item", name="indium-solder", amount=2}}, results = {{type="item", name="airtight-seal", amount=2}}, } }) diff --git a/Indium2/prototypes/technology.lua b/Indium2/prototypes/technology.lua index e39f945..09eade6 100644 --- a/Indium2/prototypes/technology.lua +++ b/Indium2/prototypes/technology.lua @@ -57,7 +57,7 @@ data:extend( } }, }) -if (mods["bztin2"] and mods["bismuth"]) or false then +if (util.bz.tin and mods["bismuth"]) or false then data:extend( { { @@ -65,7 +65,7 @@ data:extend( name = "indium-pcb-solder", icons = { - { icon = "__bztin2__/graphics/icons/solder.png", icon_size = 128, tint = {r = 0.7, g = 0.5, b = 0.9, a = 1} }, + { icon = "__" .. util.bz.tin .. "__/graphics/icons/solder.png", icon_size = 128, tint = {r = 0.7, g = 0.5, b = 0.9, a = 1} }, { icon = "__Indium2__/graphics/icons/indium-plate.png", icon_size = 64, shift= {-8, -8}}, }, prerequisites = {"indium-processing"}, diff --git a/Indium2/recipe-modify.lua b/Indium2/recipe-modify.lua index 76ad0e0..de54e08 100644 --- a/Indium2/recipe-modify.lua +++ b/Indium2/recipe-modify.lua @@ -4,8 +4,8 @@ local util = require("data-util") -- Mod changes if mods["IfNickel-Updated"] then - if mods["IfNickel-Updated"] and mods["bztungsten2"] then - util.replace_some_ingredient(mods["IfNickel-Updated"] and "gimbaled-thruster", mods["bztungsten2"] and "rocket-engine-nozzle", 1, "cryogenic-seal", 1) + if mods["IfNickel-Updated"] and util.bz.thungsten then + util.replace_some_ingredient(mods["IfNickel-Updated"] and "gimbaled-thruster", util.bz.thungsten and "rocket-engine-nozzle", 1, "cryogenic-seal", 1) end util.remove_ingredient("satellite", "gimbaled-thruster") end From be3de186f227e57187d6eba8a332890ee26c33c0 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 1 Nov 2025 12:46:20 +0100 Subject: [PATCH 2/2] Fix booleans being strings --- Indium2/data-util.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Indium2/data-util.lua b/Indium2/data-util.lua index 52c9094..76dd950 100644 --- a/Indium2/data-util.lua +++ b/Indium2/data-util.lua @@ -869,8 +869,8 @@ function util.replace_ingredients_prior_to(tech, old, new, multiplier) end util.remove_prior_unlocks(tech, old) for i, recipe in pairs(data.raw.recipe) do - if (recipe.enabled and recipe.enabled ~= 'false') - and (not recipe.hidden or recipe.hidden == 'true') -- probably don't want to change hidden recipes + if (recipe.enabled and recipe.enabled ~= false) + and (not recipe.hidden or recipe.hidden == true) -- probably don't want to change hidden recipes and string.sub(recipe.name, 1, 3) ~= 'se-' -- have to exlude SE in general :( then -- log("BZZZ due to 'enabled' replacing " .. old .. " with " .. new .." in " .. recipe.name) -- Handy Debug :|