From 29eed595fa220748dff2bcdc46eaaf023cdf82a7 Mon Sep 17 00:00:00 2001 From: pla Date: Sat, 1 Nov 2025 12:41:07 +0100 Subject: [PATCH 01/13] 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 02/13] 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 :| From cd771d5e0cb090d21a3fa4aed4c003d6aba03e4c Mon Sep 17 00:00:00 2001 From: pla Date: Sat, 1 Nov 2025 12:56:40 +0100 Subject: [PATCH 03/13] Fix K2 matter recipes and tech (#2) ![image](/attachments/3ad3274d-1933-469b-9eb9-caeca53e5a4a) Co-authored-by: pla Reviewed-on: https://git.cacklingfiend.info/cacklingfiend/Indium2/pulls/2 Co-authored-by: pla Co-committed-by: pla --- Indium2/locale/en/Indium.cfg | 1 + Indium2/prototypes/indium-matter.lua | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Indium2/locale/en/Indium.cfg b/Indium2/locale/en/Indium.cfg index d35c2ba..6093623 100644 --- a/Indium2/locale/en/Indium.cfg +++ b/Indium2/locale/en/Indium.cfg @@ -1,5 +1,6 @@ [technology-name] indium-processing=Indium processing +indium-matter-processing=Indium conversion indium-pcb-solder=Indium pcb solder [technology-description] diff --git a/Indium2/prototypes/indium-matter.lua b/Indium2/prototypes/indium-matter.lua index bad09f1..5873bd6 100644 --- a/Indium2/prototypes/indium-matter.lua +++ b/Indium2/prototypes/indium-matter.lua @@ -10,15 +10,16 @@ data:extend( icons = { { - icon = "__Krastorio2Assets__/technologies/matter-coal.png", + icon = "__Krastorio2Assets__/technologies/backgrounds/matter.png", icon_size = 256, }, { icon = "__Indium2__/graphics/icons/indite-ore.png", icon_size = 64, - scale = 1.4, + scale = 1, } }, + effects = {}, prerequisites = {"kr-matter-processing"}, unit = { @@ -38,16 +39,16 @@ matter.make_recipes({ material = { type = "item", name = "indite-ore", amount = 10 }, matter_count = 5, energy_required = 1, - need_stabilizer = false, - unlocked_by_technology = "indium-matter-processing" + needs_stabilizer = false, + unlocked_by = "indium-matter-processing" }) -matter.make_recipes({ +matter.make_deconversion_recipe({ material = { type = "item", name = "indium-plate", amount = 10 }, matter_count = 10, energy_required = 3, - only_deconversion = true, - need_stabilizer = true, - unlocked_by_technology = "indium-matter-processing" + -- only_deconversion = true, + needs_stabilizer = true, + unlocked_by = "indium-matter-processing" }) end \ No newline at end of file From 9c1051112c5cb42501e7d36662d63e7839a83059 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 1 Nov 2025 23:06:10 +0100 Subject: [PATCH 04/13] 2.0.4 --- Indium2/changelog.txt | 7 +++++++ Indium2/info.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Indium2/changelog.txt b/Indium2/changelog.txt index 0ad9cda..bf74e8b 100644 --- a/Indium2/changelog.txt +++ b/Indium2/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.4 +Date: 01.11.2025 + Changes: + - This mod can now be used with either original bz mods or the forks + Bug Fixes: + - Fix K2 matter integration (thanks pla) +--------------------------------------------------------------------------------------------------- Version: 2.0.3 Date: 21.10.2025 Changes: diff --git a/Indium2/info.json b/Indium2/info.json index 74d7857..b23af4a 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -1,6 +1,6 @@ { "name": "Indium2", - "version": "2.0.3", + "version": "2.0.4", "factorio_version": "2.0", "title": "Indium", "description": "Indium2 is a mod adding the element indium.\n\nThis mod is inspired by Brevven's BZ mods.", From e8cedf980d2b61b7b601d77110d9de6bd53f254a Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Tue, 27 Jan 2026 22:57:27 +0100 Subject: [PATCH 05/13] K2SE: Use advanced tech card in optimization tech card --- Indium2/recipe-final-fix.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Indium2/recipe-final-fix.lua b/Indium2/recipe-final-fix.lua index b31d401..7356e16 100644 --- a/Indium2/recipe-final-fix.lua +++ b/Indium2/recipe-final-fix.lua @@ -6,14 +6,19 @@ util.remove_ingredient("chemical-science-pack", "el_energy_crystal_item") util.add_ingredient("chemical-science-pack", "blank-advanced-tech-card", 5) if mods["space-exploration"] then - util.remove_ingredient("se-rocket-science-pack", "kr-blank-tech-card") - util.add_ingredient("se-rocket-science-pack", "blank-advanced-tech-card", 8) - util.add_product("se-core-fragment-omni",{ type = "item", name = "indite-ore", amount = 3 }) + util.remove_ingredient("se-rocket-science-pack", "kr-blank-tech-card") + util.add_ingredient("se-rocket-science-pack", "blank-advanced-tech-card", 8) + util.add_product("se-core-fragment-omni", { type = "item", name = "indite-ore", amount = 3 }) + + if mods["Krastorio2"] then + util.remove_ingredient("kr-optimization-tech-card", "kr-blank-tech-card") + util.add_ingredient("kr-optimization-tech-card", "blank-advanced-tech-card", 10) + end end if mods["BrassTacks-Updated"] and mods["Krastorio2"] then - util.set_main_product("enriched-zinc", "enriched-zinc") - util.add_product("enriched-zinc", { type = "item", name = "indite-ore", amount=1}) - util.set_main_product("zinc-plate", "zinc-plate") - util.add_product("zinc-plate", {type = "item", name="indium-plate", amount=1, probability=0.1}) + util.set_main_product("enriched-zinc", "enriched-zinc") + util.add_product("enriched-zinc", { type = "item", name = "indite-ore", amount = 1 }) + util.set_main_product("zinc-plate", "zinc-plate") + util.add_product("zinc-plate", { type = "item", name = "indium-plate", amount = 1, probability = 0.1 }) end \ No newline at end of file From ebc9f758e8c41fb792475a62fc92bc25acd21368 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Tue, 27 Jan 2026 22:58:56 +0100 Subject: [PATCH 06/13] 2.0.5 --- Indium2/changelog.txt | 5 +++++ Indium2/info.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Indium2/changelog.txt b/Indium2/changelog.txt index bf74e8b..839211f 100644 --- a/Indium2/changelog.txt +++ b/Indium2/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.5 +Date: 27.01.2026 + Changes: + - K2SE: Use advanced tech card in optimization tech card +--------------------------------------------------------------------------------------------------- Version: 2.0.4 Date: 01.11.2025 Changes: diff --git a/Indium2/info.json b/Indium2/info.json index b23af4a..9cf9592 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -1,6 +1,6 @@ { "name": "Indium2", - "version": "2.0.4", + "version": "2.0.5", "factorio_version": "2.0", "title": "Indium", "description": "Indium2 is a mod adding the element indium.\n\nThis mod is inspired by Brevven's BZ mods.", From 0f9d2b9605c96352a51903d31c40505171a85a17 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 12:44:46 +0100 Subject: [PATCH 07/13] Switch to bzlib --- Indium2/data-util.lua | 944 ------------------------ Indium2/info.json | 1 + Indium2/prototypes/indite-enriched.lua | 2 +- Indium2/prototypes/indite-ore.lua | 2 +- Indium2/prototypes/indium-248k.lua | 2 +- Indium2/prototypes/indium-recipe-se.lua | 2 +- Indium2/prototypes/indium-recipe.lua | 2 +- Indium2/prototypes/technology.lua | 2 +- Indium2/recipe-final-fix.lua | 2 +- Indium2/recipe-modify.lua | 2 +- 10 files changed, 9 insertions(+), 952 deletions(-) delete mode 100644 Indium2/data-util.lua diff --git a/Indium2/data-util.lua b/Indium2/data-util.lua deleted file mode 100644 index 76dd950..0000000 --- a/Indium2/data-util.lua +++ /dev/null @@ -1,944 +0,0 @@ -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) - if mods["space-exploration"] then - if not params.icon_size then params.icon_size = 64 end - local lname="landfill-"..params.ore - data:extend({ - { - type = "recipe", - icons = { - { icon = "__base__/graphics/icons/landfill.png", icon_size = 64, icon_mipmaps = 3 }, - { icon = "__Indium2__/graphics/icons/"..params.ore..".png", icon_size = params.icon_size, scale = 0.33*64/params.icon_size}, - }, - energy_required = 1, - enabled=false, - name = lname, - category = "hard-recycling", - order = "z-b-"..params.ore, - subgroup = "terrain", - results = {{type="item", name="landfill", amount=1}}, - ingredients = {{type="item", name=params.ore, amount=50}}, - } - }) - util.add_unlock("se-recycling-facility", lname) - end -end - --- se matter --- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out -function util.se_matter(params) - if not params.quant_in then params.quant_in = params.quant_out end - if not params.icon_size then params.icon_size = 64 end - local fname = "matter-fusion-"..params.ore - local sedata = mods["Krastorio2"] and "se-kr-matter-synthesis-data" or "se-fusion-test-data" - local sejunk = mods["Krastorio2"] and "se-broken-data" or "se-junk-data" - data:extend({ - { - type = "recipe", - name = fname, - localised_name = {"recipe-name.se-matter-fusion-to", {"item-name."..params.ore}}, - category = "space-materialisation", - subgroup = "materialisation", - order = "a-b-z", - icons = { - {icon = "__space-exploration-graphics__/graphics/blank.png", - icon_size = 64, scale = 0.5}, - {icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", - icon_size = 64, scale = 0.33, shift = {8,-8}}, - {icon = "__Indium2__/graphics/icons/"..params.ore..".png", - icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={-8, 8}}, - {icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", - icon_size = 64, scale = 0.5}, - }, - energy_required = params.energy_required, - enabled = false, - ingredients = { - {type = "item", name = sedata, amount=1}, - {type="fluid", name="se-particle-stream", amount=50}, - {type="fluid", name="se-space-coolant-supercooled", amount=25}, - }, - results = { - {type = "item", name = params.ore, amount = params.quant_out}, - {type="item", name="se-contaminated-scrap", amount=1}, - {type="item", name=sedata, amount=1, probability=.99}, - {type="item", name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity = 25, ignored_by_stats = 25}, - } - } - }) - util.add_unlock("se-space-matter-fusion", fname) - - if mods["Krastorio2"] then - local lname = params.ore.."-to-particle-stream" - data:extend({ - enabled = false, - { - type = "recipe", - name = lname, - localised_name = {"recipe-name.se-kr-matter-liberation", {"item-name."..params.ore}}, - category = "space-materialisation", - subgroup = "advanced-particle-stream", - order = "a-b-z", - icons = { - {icon = "__space-exploration-graphics__/graphics/blank.png", - icon_size = 64, scale = 0.5}, - {icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", - icon_size = 64, scale = 0.33, shift = {-8,8}}, - {icon = "__Indium2__/graphics/icons/"..params.ore..".png", - icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={8, -8}}, - {icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", - icon_size = 64, scale = 0.5}, - }, - energy_required = 30, - enabled = false, - ingredients = { - {type="item", name="se-kr-matter-liberation-data", amount=1}, - {type="item", name=params.ore, amount=params.quant_in}, - {type="fluid", name="se-particle-stream", amount=50}, - }, - results = { - {type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99}, - {type="item", name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity = 50, ignored_by_stats = 50}, - } - } - }) - if not data.raw.technology["bz-advanced-stream-production"] then - data:extend({ - { - type = "technology", - name ="bz-advanced-stream-production", - localised_name = {"", {"technology-name.se-kr-advanced-stream-production"}, " 2"}, - icon = "__space-exploration-graphics__/graphics/technology/material-fabricator.png", - icon_size = 128, - effects = {}, - unit = { - count = 100, - time = 15, - ingredients = { - {"automation-science-pack", 1}, - {"logistic-science-pack", 1}, - {"chemical-science-pack", 1}, - {"se-rocket-science-pack", 1}, - {"space-science-pack", 1}, - {"production-science-pack", 1}, - {"utility-science-pack", 1}, - {"se-astronomic-science-pack-4", 1}, - {"se-energy-science-pack-4", 1}, - {"se-material-science-pack-4", 1}, - {"kr-matter-tech-card", 1}, - {"se-deep-space-science-pack-1", 1}, - } - }, - prerequisites = {"se-kr-advanced-stream-production"}, - }, - }) - end - util.add_unlock("bz-advanced-stream-production", lname) - end -end - --- Get the normal prototype for a recipe -- either .normal or the recipe itself -function util.get_normal(recipe_name) - if data.raw.recipe[recipe_name] then - recipe = data.raw.recipe[recipe_name] - if recipe.ingredients then - return recipe - end - end -end - --- Set/override a technology's prerequisites -function util.set_prerequisite(technology_name, prerequisites) - local technology = data.raw.technology[technology_name] - if technology then - technology.prerequisites = {} - for i, prerequisite in pairs(prerequisites) do - if data.raw.technology[prerequisite] then - table.insert(technology.prerequisites, prerequisite) - end - end - end -end - --- Add a prerequisite to a given technology -function util.add_prerequisite(technology_name, prerequisite) - local technology = data.raw.technology[technology_name] - if technology and data.raw.technology[prerequisite] then - if technology.prerequisites then - for i, pre in pairs(technology.prerequisites) do - if pre == prerequisite then return end - end - table.insert(technology.prerequisites, prerequisite) - else - technology.prerequisites = {prerequisite} - end - end -end - --- Remove a prerequisite from a given technology -function util.remove_prerequisite(technology_name, prerequisite) - local technology = data.raw.technology[technology_name] - local index = -1 - if technology then - for i, prereq in pairs(technology.prerequisites) do - if prereq == prerequisite then - index = i - break - end - end - if index > -1 then - table.remove(technology.prerequisites, index) - end - end -end - - --- Add an effect to a given technology -function util.add_effect(technology_name, effect) - local technology = data.raw.technology[technology_name] - if technology then - if not technology.effects then technology.effects = {} end - if effect and effect.type == "unlock-recipe" then - if not data.raw.recipe[effect.recipe] then - return - end - table.insert(technology.effects, effect) - end - end -end - --- Add an effect to a given technology to unlock recipe -function util.add_unlock(technology_name, recipe) - util.add_effect(technology_name, {type="unlock-recipe", recipe=recipe}) -end - --- remove recipe unlock effect from a given technology, multiple times if necessary -function util.remove_recipe_effect(technology_name, recipe_name) - local technology = data.raw.technology[technology_name] - local index = -1 - local cnt = 0 - if technology and technology.effects then - for i, effect in pairs(technology.effects) do - if effect.type == "unlock-recipe" and effect.recipe == recipe_name then - index = i - cnt = cnt + 1 - end - end - if index > -1 then - table.remove(technology.effects, index) - if cnt > 1 then -- not over yet, do it again - util.remove_recipe_effect(technology_name, recipe_name) - end - end - end -end - --- Set technology ingredients -function util.set_tech_recipe(technology_name, ingredients) - local technology = data.raw.technology[technology_name] - if technology then - technology.unit.ingredients = ingredients - end -end - -function util.set_enabled(recipe_name, enabled) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].enabled = enabled - end -end - -function util.set_hidden(recipe_name) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].hidden = true - end -end - --- Add a given quantity of ingredient to a given recipe -function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity) - if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then - add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) - end -end - -function add_or_add_to_ingredient(recipe, ingredient, quantity) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing[1] == ingredient or existing.name == ingredient then - add_to_ingredient(recipe, ingredient, quantity) - return - end - end - table.insert(recipe.ingredients, {ingredient, quantity}) - end -end - --- Add a given quantity of ingredient to a given recipe -function util.add_ingredient(recipe_name, ingredient, quantity) - local is_fluid = not not data.raw.fluid[ingredient] - if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then - add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid) - end -end - -function add_ingredient(recipe, ingredient, quantity, is_fluid) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == ingredient then - return - end - end - if is_fluid then - table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity}) - else - table.insert(recipe.ingredients, {type = "item", name = ingredient, amount = quantity}) - end - end -end - --- Add a given ingredient prototype to a given recipe -function util.add_ingredient_raw(recipe_name, ingredient) - if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then - add_ingredient_raw(data.raw.recipe[recipe_name], ingredient) - end -end - -function add_ingredient_raw(recipe, ingredient) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if (existing.name and existing.name == ingredient.name) then - return - end - end - table.insert(recipe.ingredients, ingredient) - end -end - --- Set an ingredient to a given quantity -function util.set_ingredient(recipe_name, ingredient, quantity) - if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then - set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) - end -end - -function set_ingredient(recipe, ingredient, quantity) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == ingredient then - existing.amount = quantity - existing.amount_min = nil - existing.amount_max = nil - return - end - end - table.insert(recipe.ingredients, {ingredient, quantity}) - end -end --- Add a given quantity of product to a given recipe. --- Only works for recipes with multiple products -function util.add_product(recipe_name, product) - if data.raw.recipe[recipe_name] and - (data.raw.item[product.name] or data.raw.fluid[product.name]) then - add_product(data.raw.recipe[recipe_name], product) - end -end - -function add_product(recipe, product) - if recipe ~= nil then - if recipe.results == nil then - recipe.results = {} - end - table.insert(recipe.results, product) - end -end - --- Get the amount of the ingredient, will check base/normal not expensive -function util.get_ingredient_amount(recipe_name, ingredient_name) - local recipe = data.raw.recipe[recipe_name] - if recipe then - if recipe.ingredients then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == ingredient_name then return ingredient.amount end - end - end - return 1 - end - return 0 -end - --- Get the amount of the result, will check base/normal not expensive -function util.get_amount(recipe_name, product) - if not product then product = recipe_name end - local recipe = data.raw.recipe[recipe_name] - if recipe then - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name == product then return result.amount end - end - end - return 1 - end - return 0 -end - --- Replace one ingredient with another in a recipe --- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true. -function util.replace_ingredient(recipe_name, old, new, amount, multiply) - if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then - replace_ingredient(data.raw.recipe[recipe_name], old, new, amount or 1, multiply) - end -end - -function replace_ingredient(recipe, old, new, amount, multiply) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == new then - return - end - end - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == old then - ingredient.name = new - if multiply then - ingredient.amount = amount * ingredient.amount - else - ingredient.amount = amount - end - end - end - end -end - --- Remove an ingredient from a recipe -function util.remove_ingredient(recipe_name, old) - if data.raw.recipe[recipe_name] then - remove_ingredient(data.raw.recipe[recipe_name], old) - end -end - -function remove_ingredient(recipe, old) - index = -1 - if recipe ~= nil and recipe.ingredients ~= nil then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == old then - index = i - break - end - end - if index > -1 then - table.remove(recipe.ingredients, index) - end - end -end - --- Replace an amount of an ingredient in a recipe. Keep at least 1 of old. -function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount) - local is_fluid = not not data.raw.fluid[new] - if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then - replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) - end -end - -function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fluid) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing.name == new then - return - end - end - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == old then - ingredient.amount = math.max(1, ingredient.amount - old_amount) - end - end - add_ingredient(recipe, new, new_amount, is_fluid) - end -end - --- set the amount of a product. -function util.set_product_amount(recipe_name, product, amount) - if data.raw.recipe[recipe_name] then - set_product_amount(data.raw.recipe[recipe_name], product, amount) - end -end - -function set_product_amount(recipe, product, amount) - if recipe then - if recipe.result_count then - recipe.result_count = amount - end - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name == product then - if result.amount then - result.amount = amount - end - if result.amount_min ~= nil then - result.amount_min = nil - result.amount_max = nil - result.amount = amount - end - end - if result[1] == product then - result[2] = amount - end - end - end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = amount - end - end -end - --- multiply the cost, energy, and results of a recipe by a multiple -function util.multiply_recipe(recipe_name, multiple) - if data.raw.recipe[recipe_name] then - multiply_recipe(data.raw.recipe[recipe_name], multiple) - end -end - -function multiply_recipe(recipe, multiple) - if recipe then - if recipe.energy_required then - recipe.energy_required = recipe.energy_required * multiple - end - if recipe.result_count then - recipe.result_count = recipe.result_count * multiple - end - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name then - if result.amount then - result.amount = result.amount * multiple - end - if result.amount_min ~= nil then - result.amount_min = result.amount_min * multiple - result.amount_max = result.amount_max * multiple - end - if result.catalyst_amount then - result.catalyst_amount = result.catalyst_amount * multiple - end - end - if result[1] then - result[2] = result[2] * multiple - end - end - end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = multiple - end - if recipe.ingredients then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name then - ingredient.amount = ingredient.amount * multiple - end - if ingredient[1] then - ingredient[2] = ingredient[2] * multiple - end - end - end - end -end - --- Returns true if a recipe has an ingredient -function util.has_ingredient(recipe_name, ingredient) - return data.raw.recipe[recipe_name] and - has_ingredient(data.raw.recipe[recipe_name], ingredient) -end - -function has_ingredient(recipe, ingredient) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, existing in pairs(recipe.ingredients) do - if existing[1] == ingredient or existing.name == ingredient then - return true - end - end - end - return false -end - --- Remove a product from a recipe, WILL NOT remove the only product -function util.remove_product(recipe_name, old) - if data.raw.recipe[recipe_name] then - remove_product(data.raw.recipe[recipe_name], old) - end -end - -function remove_product(recipe, old) - index = -1 - if recipe ~= nil and recipe.results ~= nil then - for i, result in pairs(recipe.results) do - if result.name == old or result[1] == old then - index = i - break - end - end - if index > -1 then - table.remove(recipe.results, index) - end - end -end - -function util.set_main_product(recipe_name, product) - if data.raw.recipe[recipe_name] then - set_main_product(data.raw.recipe[recipe_name], product) - end -end - -function set_main_product(recipe, product) - if recipe then - recipe.main_product = product - end -end - --- Replace one product with another in a recipe -function util.replace_product(recipe_name, old, new) - if data.raw.recipe[recipe_name] then - replace_product(data.raw.recipe[recipe_name], old, new) - end -end - -function replace_product(recipe, old, new) - if recipe then - if recipe.main_product == old then - recipe.main_product = new - end - if recipe.result == old then - recipe.result = new - return - end - if recipe.results then - for i, result in pairs(recipe.results) do - if result.name == old then result.name = new end - if result[1] == old then result[1] = new end - end - end - end -end - --- Remove an element of type t and name from data.raw -function util.remove_raw(t, name) - if not data.raw[t] then - log(t.." not found in data.raw") - return - end - if data.raw[t][name] then - for i, elem in pairs(data.raw[t]) do - if elem.name == name then - data.raw[t][i] = nil - break - end - end - end -end - --- Set energy required -function util.set_recipe_time(recipe_name, time) - if data.raw.recipe[recipe_name] then - set_recipe_time(data.raw.recipe[recipe_name], time) - end -end - -function set_recipe_time(recipe, time) - if recipe then - if recipe.energy_required then - recipe.energy_required = time - end - end -end - --- Multiply energy required -function util.multiply_time(recipe_name, factor) - if data.raw.recipe[recipe_name] then - multiply_time(data.raw.recipe[recipe_name], factor) - end -end - -function multiply_time(recipe, factor) - if recipe then - if recipe.energy_required then - recipe.energy_required = recipe.energy_required * factor - end - end -end - --- Add to energy required -function util.add_time(recipe_name, amount) - if data.raw.recipe[recipe_name] then - add_time(data.raw.recipe[recipe_name], amount) - end -end - -function add_time(recipe, amount) - if recipe then - if recipe.energy_required then - recipe.energy_required = recipe.energy_required + amount - end - end -end - --- Set recipe category -function util.set_category(recipe_name, category) - if data.raw.recipe[recipe_name] and data.raw["recipe-category"][category] then - data.raw.recipe[recipe_name].category = category - end -end - --- Set recipe subgroup -function util.set_subgroup(recipe_name, subgroup) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].subgroup = subgroup - end -end - --- Set item subgroup -function util.set_item_subgroup(item, subgroup) - if data.raw.item[item] and data.raw["item-subgroup"][subgroup] then - data.raw.item[item].subgroup = subgroup - end -end - -function util.add_icon(recipe_name, icon) - if data.raw.recipe[recipe_name] then - if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then - data.raw.recipe[recipe_name].icons = {{ - icon=data.raw.recipe[recipe_name].icon, - icon_size=data.raw.recipe[recipe_name].icon_size, - icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps, - }} - data.raw.recipe[recipe_name].icon = nil - data.raw.recipe[recipe_name].icon_size = nil - end - table.insert(data.raw.recipe[recipe_name].icons, icon) - end -end - --- Set recipe icons -function util.set_icons(recipe_name, icons) - if data.raw.recipe[recipe_name] then - data.raw.recipe[recipe_name].icons = icons - data.raw.recipe[recipe_name].icon = nil - data.raw.recipe[recipe_name].icon_size = nil - end -end - --- Set recipe icons -function util.set_item_icons(item_name, icons) - if data.raw.item[item_name] then - data.raw.item[item_name].icons = icons - data.raw.item[item_name].icon = nil - data.raw.item[item_name].icon_size = nil - end -end - --- Gets an item or fluid icon -function util.get_item_or_fluid_icon(name) - icon = "" - if data.raw.item[name] then - icon = data.raw.item[name].icon - if not icon then icon = data.raw.item[name].icons[1].icon end - elseif data.raw.fluid[name] then - icon = data.raw.fluid[name].icon - if not icon then icon = data.raw.fluid[name].icons[1].icon end - end - return icon -end - -function util.set_to_founding(recipe) - util.set_category(recipe, "founding") - util.set_subgroup(recipe, "foundry-intermediate") -end - --- Add crafting category to an entity -function util.add_crafting_category(entity_type, entity, category) - if data.raw[entity_type][entity] and data.raw["recipe-category"][category] then - for i, existing in pairs(data.raw[entity_type][entity].crafting_categories) do - if existing == category then - return - end - end - table.insert(data.raw[entity_type][entity].crafting_categories, category) - end -end - -function util.add_to_ingredient(recipe, ingredient, amount) - if data.raw.recipe[recipe] then - add_to_ingredient(data.raw.recipe[recipe], ingredient, amount) - end -end - -function add_to_ingredient(recipe, it, amount) - if recipe ~= nil and recipe.ingredients ~= nil then - for i, ingredient in pairs(recipe.ingredients) do - if ingredient.name == it then - ingredient.amount = ingredient.amount + amount - return - end - if ingredient[1] == it then - ingredient[2] = ingredient[2] + amount - return - end - end - end -end - -function util.add_to_product(recipe_name, product, amount) - if data.raw.recipe[recipe_name] then - add_to_product(data.raw.recipe[recipe_name], product, amount) - end -end - -function add_to_product(recipe, product, amount) - if recipe ~= nil and recipe.results ~= nil then - if recipe.result == product then - recipe.result_count = recipe.result_count + amount - return - end - for i, result in pairs(recipe.results) do - if result.name == product then - result.amount = result.amount + amount - return - end - if result[1] == product then - result[2] = result[2] + amount - return - end - end - end -end - --- Adds a result to a mineable type -function util.add_minable_result(t, name, result) - if data.raw[t] and data.raw[t][name] and data.raw[t][name].minable then - if data.raw[t][name].minable.result and not data.raw[t][name].minable.results then - data.raw[t][name].minable.results = { - {data.raw[t][name].minable.result ,data.raw[t][name].minable.count}} - data.raw[t][name].minable.result = nil - data.raw[t][name].minable.result_count = nil - end - if data.raw[t][name].minable.results then - table.insert(data.raw[t][name].minable.results, result) - end - end -end - -function util.remove_prior_unlocks(tech, recipe) - if data.raw.technology[tech].prerequisites then - for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do - remove_prior_unlocks(prerequisite, recipe) - end - end -end - -function remove_prior_unlocks(tech, recipe) - local technology = data.raw.technology[tech] - if technology then - util.remove_recipe_effect(tech, recipe) - if technology.prerequisites then - for i, prerequisite in pairs(technology.prerequisites) do - -- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :| - remove_prior_unlocks(prerequisite, recipe) - end - end - end -end - -function util.replace_ingredients_prior_to(tech, old, new, multiplier) - if not data.raw.technology[tech] then - log("Not replacing ingredient "..old.." with "..new.." because tech "..tech.." was not found") - return - 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 - 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 :| - util.replace_ingredient(recipe.name, old, new, multiplier, true) - end - end - if data.raw.technology[tech].prerequisites then - for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do - replace_ingredients_prior_to(prerequisite, old, new, multiplier) - end - end -end - -function replace_ingredients_prior_to(tech, old, new, multiplier) - local technology = data.raw.technology[tech] - if technology then - if technology.effects then - for i, effect in pairs(technology.effects) do - if effect.type == "unlock-recipe" then - -- log("BZZZ replacing " .. old .. " with " .. new .." in " .. effect.recipe) -- Handy Debug :| - util.replace_ingredient(effect.recipe, old, new, multiplier, true) - end - end - end - if technology.prerequisites then - for i, prerequisite in pairs(technology.prerequisites) do - -- log("BZZZ checking " .. prerequisite) -- Handy Debug :| - replace_ingredients_prior_to(prerequisite, old, new, multiplier) - end - end - end -end - -function util.remove_all_recipe_effects(recipe_name) - for name, _ in pairs(data.raw.technology) do - util.remove_recipe_effect(name, recipe_name) - end -end - -function util.add_unlock_force(technology_name, recipe) - util.set_enabled(recipe, false) - util.remove_all_recipe_effects(recipe) - util.add_unlock(technology_name, recipe) -end - --- sum the products of a recipe -function util.sum_products(recipe_name) - -- this is going to end up approximate in some cases, integer division is probs fine - if data.raw.recipe[recipe_name] then - local recipe = data.raw.recipe[recipe_name] - if not recipe.results then return recipe.result_count end - local sum = 0 - for i, result in pairs(recipe.results) do - local amt = 0 - if result[2] then amt = result[2] - elseif result.amount then amt = result.amount - elseif result.amount_min then amt = (result.amount_min + result.amount_max)/2 - end - if result.probability then amt = amt * result.probability end - sum = sum + amt - end - return sum - end - return 0 -end - -function util.add_productivity(recipe) - data.raw.recipe[recipe].allow_productivity = true -end - -return util \ No newline at end of file diff --git a/Indium2/info.json b/Indium2/info.json index 9cf9592..1336f46 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -8,6 +8,7 @@ "homepage": "https://discord.gg/ufvFUJtVwk", "dependencies": [ "base >= 2.0.0", + "bzlib", "? bismuth", "? BrassTacks-Updated", "? bzcarbon", diff --git a/Indium2/prototypes/indite-enriched.lua b/Indium2/prototypes/indite-enriched.lua index b407f6c..10420a9 100644 --- a/Indium2/prototypes/indite-enriched.lua +++ b/Indium2/prototypes/indite-enriched.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") if mods["Krastorio2"] then data:extend({ diff --git a/Indium2/prototypes/indite-ore.lua b/Indium2/prototypes/indite-ore.lua index 36c4285..004124b 100644 --- a/Indium2/prototypes/indite-ore.lua +++ b/Indium2/prototypes/indite-ore.lua @@ -1,6 +1,6 @@ local resource_autoplace = require('resource-autoplace'); local item_sounds = require('__base__.prototypes.item_sounds') -local util = require("data-util") +local util = require("__bzlib__/data-util") data.raw.planet.nauvis.map_gen_settings.autoplace_controls["indite-ore"] = {} data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["indite-ore"] = {} diff --git a/Indium2/prototypes/indium-248k.lua b/Indium2/prototypes/indium-248k.lua index 96cf439..2f08feb 100644 --- a/Indium2/prototypes/indium-248k.lua +++ b/Indium2/prototypes/indium-248k.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") if mods["248k-Redux"] then data:extend({ diff --git a/Indium2/prototypes/indium-recipe-se.lua b/Indium2/prototypes/indium-recipe-se.lua index 99c8f7b..c68acb1 100644 --- a/Indium2/prototypes/indium-recipe-se.lua +++ b/Indium2/prototypes/indium-recipe-se.lua @@ -1,5 +1,5 @@ -- Additional recipes if Space Exploration mod is enabled -local util = require("data-util") +local util = require("__bzlib__/data-util") if mods["space-exploration"] then se_delivery_cannon_recipes["indite-ore"] = {name= "indite-ore"} diff --git a/Indium2/prototypes/indium-recipe.lua b/Indium2/prototypes/indium-recipe.lua index 82c255f..9d1ea2b 100644 --- a/Indium2/prototypes/indium-recipe.lua +++ b/Indium2/prototypes/indium-recipe.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") data:extend({{ type = "item-subgroup", diff --git a/Indium2/prototypes/technology.lua b/Indium2/prototypes/technology.lua index 09eade6..adca269 100644 --- a/Indium2/prototypes/technology.lua +++ b/Indium2/prototypes/technology.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") local indium_processing_effects ={ { diff --git a/Indium2/recipe-final-fix.lua b/Indium2/recipe-final-fix.lua index 7356e16..56e6402 100644 --- a/Indium2/recipe-final-fix.lua +++ b/Indium2/recipe-final-fix.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") util.remove_ingredient("chemical-science-pack", "kr-blank-tech-card") util.remove_ingredient("chemical-science-pack", "bismuth-glass") diff --git a/Indium2/recipe-modify.lua b/Indium2/recipe-modify.lua index de54e08..d7a2bcf 100644 --- a/Indium2/recipe-modify.lua +++ b/Indium2/recipe-modify.lua @@ -1,4 +1,4 @@ -local util = require("data-util") +local util = require("__bzlib__/data-util") -- Main vanilla changes From bcc3063ded0cd4002bdeed656627f89447bb799e Mon Sep 17 00:00:00 2001 From: Morganite Date: Mon, 23 Feb 2026 22:26:45 -0600 Subject: [PATCH 08/13] 248k update fixes --- Indium2/info.json | 1 + Indium2/prototypes/indium-recipe.lua | 4 ++-- Indium2/recipe-final-fix.lua | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Indium2/info.json b/Indium2/info.json index 1336f46..250fe4e 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -9,6 +9,7 @@ "dependencies": [ "base >= 2.0.0", "bzlib", + "? 248k-Redux >= 0.1.35", "? bismuth", "? BrassTacks-Updated", "? bzcarbon", diff --git a/Indium2/prototypes/indium-recipe.lua b/Indium2/prototypes/indium-recipe.lua index 9d1ea2b..6efc761 100644 --- a/Indium2/prototypes/indium-recipe.lua +++ b/Indium2/prototypes/indium-recipe.lua @@ -177,9 +177,9 @@ if mods["BrassTacks-Updated"] and data.raw.item["airtight-seal"]then util.add_productivity("indium-airtight-seal") end -local blank_advanced_tech_card_ingredients = {(data.raw.item["kr-blank-tech-card"] and {type="item", name="kr-blank-tech-card", amount=2}) or {type="item", name="steel-plate", amount=2},(data.raw.item[mods["Krastorio2"] and "kr-glass" or "glass"] and {type="item", name=mods["Krastorio2"] and "kr-glass" or "glass", amount=5}) or {type="item", name="copper-cable", amount=5}, {type="item", name="indium-solder", amount=2}, (data.raw.item["el_energy_crystal_item"] and {type="item", name="el_energy_crystal_item", amount=1}) or {type="item", name="battery", amount=1}} +local blank_advanced_tech_card_ingredients = {(data.raw.item["kr-blank-tech-card"] and {type="item", name="kr-blank-tech-card", amount=2}) or {type="item", name="steel-plate", amount=2},(data.raw.item[mods["Krastorio2"] and "kr-glass" or "glass"] and {type="item", name=mods["Krastorio2"] and "kr-glass" or "glass", amount=5}) or {type="item", name="copper-cable", amount=5}, {type="item", name="indium-solder", amount=2}, (data.raw.item["el_energy_crystal"] and {type="item", name="el_energy_crystal", amount=1}) or {type="item", name="battery", amount=1}} if mods["bismuth"] then - blank_advanced_tech_card_ingredients = {(data.raw.item["kr-blank-tech-card"] and {type="item", name="kr-blank-tech-card", amount=2}) or {type="item", name="steel-plate", amount=2}, {type="item", name="bismuth-glass", amount=4}, {type="item", name="indium-solder", amount=2}, (data.raw.item["el_energy_crystal_item"] and {type="item", name="el_energy_crystal_item", amount=1}) or {type="item", name="battery", amount=1}} + blank_advanced_tech_card_ingredients = {(data.raw.item["kr-blank-tech-card"] and {type="item", name="kr-blank-tech-card", amount=2}) or {type="item", name="steel-plate", amount=2}, {type="item", name="bismuth-glass", amount=4}, {type="item", name="indium-solder", amount=2}, (data.raw.item["el_energy_crystal"] and {type="item", name="el_energy_crystal", amount=1}) or {type="item", name="battery", amount=1}} end data:extend({ diff --git a/Indium2/recipe-final-fix.lua b/Indium2/recipe-final-fix.lua index 56e6402..ce31939 100644 --- a/Indium2/recipe-final-fix.lua +++ b/Indium2/recipe-final-fix.lua @@ -2,7 +2,7 @@ local util = require("__bzlib__/data-util") util.remove_ingredient("chemical-science-pack", "kr-blank-tech-card") util.remove_ingredient("chemical-science-pack", "bismuth-glass") -util.remove_ingredient("chemical-science-pack", "el_energy_crystal_item") +util.remove_ingredient("chemical-science-pack", "el_energy_crystal") util.add_ingredient("chemical-science-pack", "blank-advanced-tech-card", 5) if mods["space-exploration"] then From 536bcb56abe6f3a759eb2a6e93b9cb9349f53fa2 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 13:15:46 +0100 Subject: [PATCH 09/13] 2.1.0 --- Indium2/changelog.txt | 7 +++++++ Indium2/info.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Indium2/changelog.txt b/Indium2/changelog.txt index 839211f..b8f2331 100644 --- a/Indium2/changelog.txt +++ b/Indium2/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.0 +Date: 11.03.2026 + Changes: + - Switch to bzlib - Please install the new dependency + Bug Fixes: + - 248k: Fixes for 0.1.35 breaking changes (thanks Morganite) +--------------------------------------------------------------------------------------------------- Version: 2.0.5 Date: 27.01.2026 Changes: diff --git a/Indium2/info.json b/Indium2/info.json index 250fe4e..525907d 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -1,6 +1,6 @@ { "name": "Indium2", - "version": "2.0.5", + "version": "2.1.0", "factorio_version": "2.0", "title": "Indium", "description": "Indium2 is a mod adding the element indium.\n\nThis mod is inspired by Brevven's BZ mods.", From 320ae9fafe15517e3c20bbe10eddfff3f37af69a Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 21:48:06 +0100 Subject: [PATCH 10/13] Fixed misspelled tungsten --- Indium2/recipe-modify.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Indium2/recipe-modify.lua b/Indium2/recipe-modify.lua index d7a2bcf..adef6a1 100644 --- a/Indium2/recipe-modify.lua +++ b/Indium2/recipe-modify.lua @@ -4,8 +4,8 @@ local util = require("__bzlib__/data-util") -- Mod changes if mods["IfNickel-Updated"] then - 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) + if mods["IfNickel-Updated"] and util.bz.tungsten then + util.replace_some_ingredient(mods["IfNickel-Updated"] and "gimbaled-thruster", util.bz.tungsten and "rocket-engine-nozzle", 1, "cryogenic-seal", 1) end util.remove_ingredient("satellite", "gimbaled-thruster") end From 8943d3fa0d5bc4c3ee819ba5fe1dee6150d99549 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 13 Mar 2026 23:02:38 +0100 Subject: [PATCH 11/13] SE: Fix scrap recycling --- Indium2/recipe-modify.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Indium2/recipe-modify.lua b/Indium2/recipe-modify.lua index adef6a1..6642b1d 100644 --- a/Indium2/recipe-modify.lua +++ b/Indium2/recipe-modify.lua @@ -11,7 +11,7 @@ if mods["IfNickel-Updated"] then end if mods["space-exploration"] then - util.add_product(mods["space-exploration"] and "se-scrap-recycling", { type = "item", name = "indite-ore", amount=1, probability=0.05}) + util.add_product(mods["space-exploration"] and "se-scrap-hard-recycling", { type = "item", name = "indite-ore", amount=1, probability=0.05}) util.remove_ingredient("se-space-pipe-to-ground", "lead-plate") util.remove_ingredient("se-space-pipe-to-ground", "tin-plate") From 30e7202853bb75a3f8437c2814cd6fd69b244dda Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 16 Mar 2026 12:35:07 +0100 Subject: [PATCH 12/13] bzlib fixes --- Indium2/data-util.lua | 4 ++++ Indium2/me.lua | 7 +++++++ Indium2/prototypes/indite-enriched.lua | 2 +- Indium2/prototypes/indite-ore.lua | 2 +- Indium2/prototypes/indium-248k.lua | 2 +- Indium2/prototypes/indium-recipe-se.lua | 2 +- Indium2/prototypes/indium-recipe.lua | 2 +- Indium2/prototypes/technology.lua | 2 +- Indium2/recipe-final-fix.lua | 2 +- Indium2/recipe-modify.lua | 2 +- 10 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 Indium2/data-util.lua create mode 100644 Indium2/me.lua diff --git a/Indium2/data-util.lua b/Indium2/data-util.lua new file mode 100644 index 0000000..e2cbe2a --- /dev/null +++ b/Indium2/data-util.lua @@ -0,0 +1,4 @@ +local me = require("me") +local util = require("__bzlib__/data-util"); +util.initialize(me) +return util \ No newline at end of file diff --git a/Indium2/me.lua b/Indium2/me.lua new file mode 100644 index 0000000..4680f1e --- /dev/null +++ b/Indium2/me.lua @@ -0,0 +1,7 @@ +local me = {} + +me.name = "Indium2" +me.bypass = {} +me.add_modified = function() end + +return me diff --git a/Indium2/prototypes/indite-enriched.lua b/Indium2/prototypes/indite-enriched.lua index 10420a9..b407f6c 100644 --- a/Indium2/prototypes/indite-enriched.lua +++ b/Indium2/prototypes/indite-enriched.lua @@ -1,4 +1,4 @@ -local util = require("__bzlib__/data-util") +local util = require("data-util") if mods["Krastorio2"] then data:extend({ diff --git a/Indium2/prototypes/indite-ore.lua b/Indium2/prototypes/indite-ore.lua index 004124b..36c4285 100644 --- a/Indium2/prototypes/indite-ore.lua +++ b/Indium2/prototypes/indite-ore.lua @@ -1,6 +1,6 @@ local resource_autoplace = require('resource-autoplace'); local item_sounds = require('__base__.prototypes.item_sounds') -local util = require("__bzlib__/data-util") +local util = require("data-util") data.raw.planet.nauvis.map_gen_settings.autoplace_controls["indite-ore"] = {} data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["indite-ore"] = {} diff --git a/Indium2/prototypes/indium-248k.lua b/Indium2/prototypes/indium-248k.lua index 2f08feb..96cf439 100644 --- a/Indium2/prototypes/indium-248k.lua +++ b/Indium2/prototypes/indium-248k.lua @@ -1,4 +1,4 @@ -local util = require("__bzlib__/data-util") +local util = require("data-util") if mods["248k-Redux"] then data:extend({ diff --git a/Indium2/prototypes/indium-recipe-se.lua b/Indium2/prototypes/indium-recipe-se.lua index c68acb1..99c8f7b 100644 --- a/Indium2/prototypes/indium-recipe-se.lua +++ b/Indium2/prototypes/indium-recipe-se.lua @@ -1,5 +1,5 @@ -- Additional recipes if Space Exploration mod is enabled -local util = require("__bzlib__/data-util") +local util = require("data-util") if mods["space-exploration"] then se_delivery_cannon_recipes["indite-ore"] = {name= "indite-ore"} diff --git a/Indium2/prototypes/indium-recipe.lua b/Indium2/prototypes/indium-recipe.lua index 6efc761..4c2fc7b 100644 --- a/Indium2/prototypes/indium-recipe.lua +++ b/Indium2/prototypes/indium-recipe.lua @@ -1,4 +1,4 @@ -local util = require("__bzlib__/data-util") +local util = require("data-util") data:extend({{ type = "item-subgroup", diff --git a/Indium2/prototypes/technology.lua b/Indium2/prototypes/technology.lua index adca269..09eade6 100644 --- a/Indium2/prototypes/technology.lua +++ b/Indium2/prototypes/technology.lua @@ -1,4 +1,4 @@ -local util = require("__bzlib__/data-util") +local util = require("data-util") local indium_processing_effects ={ { diff --git a/Indium2/recipe-final-fix.lua b/Indium2/recipe-final-fix.lua index ce31939..8ca089c 100644 --- a/Indium2/recipe-final-fix.lua +++ b/Indium2/recipe-final-fix.lua @@ -1,4 +1,4 @@ -local util = require("__bzlib__/data-util") +local util = require("data-util") util.remove_ingredient("chemical-science-pack", "kr-blank-tech-card") util.remove_ingredient("chemical-science-pack", "bismuth-glass") diff --git a/Indium2/recipe-modify.lua b/Indium2/recipe-modify.lua index 6642b1d..c91224f 100644 --- a/Indium2/recipe-modify.lua +++ b/Indium2/recipe-modify.lua @@ -1,4 +1,4 @@ -local util = require("__bzlib__/data-util") +local util = require("data-util") -- Main vanilla changes From cef5e40acf6a641ea40c0ea39857142274d4a0bd Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 16 Mar 2026 21:32:36 +0100 Subject: [PATCH 13/13] 2.1.1 --- Indium2/changelog.txt | 7 +++++++ Indium2/info.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Indium2/changelog.txt b/Indium2/changelog.txt index b8f2331..ed277ee 100644 --- a/Indium2/changelog.txt +++ b/Indium2/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.1 +Date: 16.03.2026 + Bug Fixes: + - bzlib fixes + - Fixed misspelled tungsten + - SE: Fix scrap recycling +--------------------------------------------------------------------------------------------------- Version: 2.1.0 Date: 11.03.2026 Changes: diff --git a/Indium2/info.json b/Indium2/info.json index 525907d..d0b687a 100644 --- a/Indium2/info.json +++ b/Indium2/info.json @@ -1,6 +1,6 @@ { "name": "Indium2", - "version": "2.1.0", + "version": "2.1.1", "factorio_version": "2.0", "title": "Indium", "description": "Indium2 is a mod adding the element indium.\n\nThis mod is inspired by Brevven's BZ mods.",