From e979bee57b320357dd603a53156435b704b173d0 Mon Sep 17 00:00:00 2001 From: Natha <.> Date: Tue, 23 Sep 2025 16:17:24 +0200 Subject: [PATCH 01/12] SE fix --- data-util.lua | 22 +++++++++++----------- lead-recipe-se.lua | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/data-util.lua b/data-util.lua index ddf7a5d..e30ba66 100644 --- a/data-util.lua +++ b/data-util.lua @@ -504,8 +504,8 @@ function util.se_landfill(params) category = "hard-recycling", order = "z-b-"..params.ore, subgroup = "terrain", - result = "landfill", - ingredients = {{params.ore, 50}}, + results = {{type="item", name="landfill", amount=1}}, + ingredients = {{type="item", name=params.ore, amount=50}}, } }) util.add_unlock("se-recycling-facility", lname) @@ -611,15 +611,15 @@ function util.se_matter(params) energy_required = params.energy_required, enabled = false, ingredients = { - {sedata, 1}, + {type="item", name=sedata, amount=1}, {type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-space-coolant-supercooled", amount=25}, }, results = { - {params.ore, params.quant_out}, - {"se-contaminated-scrap", 1}, - {type=item, name=sedata, amount=1, probability=.99}, - {type=item, name=sejunk, amount=1, probability=.01}, + {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_stats=25, ignored_by_productivity=25}, } } @@ -650,13 +650,13 @@ function util.se_matter(params) energy_required = 30, enabled = false, ingredients = { - {"se-kr-matter-liberation-data", 1}, - {params.ore, params.quant_in}, + {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="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_stats=50, ignored_by_productivity=50}, } } diff --git a/lead-recipe-se.lua b/lead-recipe-se.lua index 4751f96..7535cc0 100644 --- a/lead-recipe-se.lua +++ b/lead-recipe-se.lua @@ -6,7 +6,7 @@ if mods["space-exploration"] then se_delivery_cannon_recipes[util.me.lead_plate] = {name= util.me.lead_plate} util.se_landfill({ore="lead-ore"}) -if string.sub(mods["space-exploration"], 1, 3) == "0.6" then +if util.se6() then util.se_matter({ore="lead-ore", energy_required=1, quant_out=10, stream_out=60}) data:extend({ { @@ -51,7 +51,7 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then }, energy_required = 60, ingredients = { - {name = util.k2() and "enriched-lead" or "lead-ore", amount = 24}, + {type="item", name = util.k2() and "enriched-lead" or "lead-ore", amount = 24}, {type = "fluid", name = "se-pyroflux", amount = 10}, }, enabled = false, @@ -63,7 +63,7 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then type = "recipe", name = "lead-ingot", category = "casting", - results = {{"lead-ingot", 1}}, + results = {{type="item", name="lead-ingot", amount=1}}, energy_required = 25, ingredients = { {type = "fluid", name = "molten-lead", amount = 250}, @@ -82,11 +82,11 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then {icon = "__bzlead__/graphics/icons/lead-ingot.png", icon_size = 128, scale = 0.125, shift = {-8, -8}}, }, results = { - {name = "lead-plate", amount = 10}, + {type="item", name = "lead-plate", amount = 10}, }, energy_required = 5, ingredients = { - {name = "lead-ingot", amount = 1} + {type="item", name = "lead-ingot", amount = 1} }, enabled = false, always_show_made_in = true, @@ -122,11 +122,11 @@ else always_show_made_in = true, allow_as_intermediate = false, ingredients = { - {name = "enriched-lead", amount = 8}, - {name = "se-vulcanite-block", amount = 1}, + {type="item", name = "enriched-lead", amount = 8}, + {type="item", name = "se-vulcanite-block", amount = 1}, }, results = { - {name = util.me.lead_plate, amount = 12}, + {type="item", name = util.me.lead_plate, amount = 12}, }, icons = { @@ -153,11 +153,11 @@ else always_show_made_in = true, allow_as_intermediate = false, ingredients = { - {name = "lead-ore", amount = 8}, - {name = "se-vulcanite-block", amount = 1}, + {type="item", name = "lead-ore", amount = 8}, + {type="item", name = "se-vulcanite-block", amount = 1}, }, results = { - {name = util.me.lead_plate, amount = util.me.byproduct() and 10 or 12}, + {type="item", name = util.me.lead_plate, amount = util.me.byproduct() and 10 or 12}, }, icons = { From 4d876db270a41be28e822c2bed57ed120da11e67 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 6 Oct 2025 12:05:28 +0200 Subject: [PATCH 02/12] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 751553b..b18a15d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.bak +.idea \ No newline at end of file From 76c19f1d530e9f2a5d42a7e3227b6d0b3ef7141b Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 6 Oct 2025 12:06:59 +0200 Subject: [PATCH 03/12] Fix some old 1.1 code --- data-util.lua | 16 ---------------- strange-matter.lua | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/data-util.lua b/data-util.lua index e30ba66..bfcf550 100644 --- a/data-util.lua +++ b/data-util.lua @@ -993,8 +993,6 @@ function add_product(recipe, product) return end end - recipe.result = nil - recipe.result_count = nil table.insert(recipe.results, product) end end @@ -1119,7 +1117,6 @@ end function replace_some_product(recipe, old, old_amount, new, new_amount) if recipe ~= nil then - if recipe.result == new then return end if recipe.results then for i, existing in pairs(recipe.results) do if existing.name == new then @@ -1211,10 +1208,6 @@ function set_product_amount(recipe, product, 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 @@ -1348,10 +1341,6 @@ function replace_product(recipe, old, new, options) 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 @@ -1611,10 +1600,6 @@ 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 @@ -1823,7 +1808,6 @@ 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 diff --git a/strange-matter.lua b/strange-matter.lua index 529267f..450c8d7 100644 --- a/strange-matter.lua +++ b/strange-matter.lua @@ -16,7 +16,7 @@ data:extend({ enabled = false, energy_required = 1, ingredients = {{type="fluid", name="strange-matter", amount = 1}}, - result = ore, + results = {{ type = "item", name = ore, amount = 1 }}, category = "crafting-with-fluid", subgroup = "synthesis", }, From 91878d4341ecf50065454433ed24086f26de05f1 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 6 Oct 2025 14:34:27 +0200 Subject: [PATCH 04/12] Remove SE version check --- data-util.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data-util.lua b/data-util.lua index bfcf550..98ed044 100644 --- a/data-util.lua +++ b/data-util.lua @@ -584,7 +584,6 @@ end -- se matter -- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out function util.se_matter(params) - if mods["space-exploration"] > "0.6" then 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 @@ -696,7 +695,6 @@ function util.se_matter(params) util.add_unlock("bz-advanced-stream-production", lname) end end -end -- deprecated -- Get the normal prototype for a recipe -- either .normal or the recipe itself @@ -993,6 +991,8 @@ function add_product(recipe, product) return end end + recipe.result = nil + recipe.result_count = nil table.insert(recipe.results, product) end end From 44a731ec8fa46c07d475ce2334a207c02d9a6d49 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 6 Oct 2025 14:41:40 +0200 Subject: [PATCH 05/12] Remove old SE code --- lead-recipe-se.lua | 68 +--------------------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/lead-recipe-se.lua b/lead-recipe-se.lua index 7535cc0..16f8766 100644 --- a/lead-recipe-se.lua +++ b/lead-recipe-se.lua @@ -6,7 +6,6 @@ if mods["space-exploration"] then se_delivery_cannon_recipes[util.me.lead_plate] = {name= util.me.lead_plate} util.se_landfill({ore="lead-ore"}) -if util.se6() then util.se_matter({ore="lead-ore", energy_required=1, quant_out=10, stream_out=60}) data:extend({ { @@ -108,69 +107,4 @@ if util.se6() then if util.me.byproduct() then util.add_product("molten-lead", {"copper-ore", 6}) end end se_delivery_cannon_recipes["lead-ingot"] = {name="lead-ingot"} -else - data.raw.item["lead-plate"].subgroup = "plates" - if util.k2() then - data:extend({ - { - type = "recipe", - name = "enriched-lead-smelting-vulcanite", - category = "smelting", - order = "d[lead-plate]", - energy_required = 24, - enabled = false, - always_show_made_in = true, - allow_as_intermediate = false, - ingredients = { - {type="item", name = "enriched-lead", amount = 8}, - {type="item", name = "se-vulcanite-block", amount = 1}, - }, - results = { - {type="item", name = util.me.lead_plate, amount = 12}, - }, - icons = - { - { icon = "__bzlead__/graphics/icons/lead-plate.png", icon_size = 64 }, - { icon = "__space-exploration-graphics__/graphics/icons/vulcanite-block.png", icon_size = 64, scale=0.25, shift= {-10, -10}}, - }, - - }, - }) - table.insert(data.raw.technology["se-processing-vulcanite"].effects, - {type = "unlock-recipe", recipe= "enriched-lead-smelting-vulcanite"}) - data.raw.recipe["enriched-lead-plate"].order= "d[lead-plate]" - se_delivery_cannon_recipes["enriched-lead"] = {name= "enriched-lead"} - else - data:extend({ - { - type = "recipe", - name = "lead-smelting-vulcanite", - category = "smelting", - subgroup = "plates", - order = "d[lead-plate]", - energy_required = 24, - enabled = false, - always_show_made_in = true, - allow_as_intermediate = false, - ingredients = { - {type="item", name = "lead-ore", amount = 8}, - {type="item", name = "se-vulcanite-block", amount = 1}, - }, - results = { - {type="item", name = util.me.lead_plate, amount = util.me.byproduct() and 10 or 12}, - }, - icons = - { - { icon = "__bzlead__/graphics/icons/lead-plate.png", icon_size = 64, icon_mipmaps = 3 }, - { icon = "__space-exploration-graphics__/graphics/icons/vulcanite-block.png", icon_size = 64, icon_mipmaps = 3, scale=0.25, shift= {-10, -10}}, - }, - - - }, - }) - if util.me.byproduct() then util.add_product("lead-smelting-vulcanite", {"copper-ore", 2}) end - table.insert(data.raw.technology["se-processing-vulcanite"].effects, - {type = "unlock-recipe", recipe= "lead-smelting-vulcanite"}) - end -end -end +end \ No newline at end of file From 605a42dcac9995f9f2a973bbfec17224668a1d36 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Wed, 8 Oct 2025 22:24:21 +0200 Subject: [PATCH 06/12] Update dependencies --- info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.json b/info.json index 82fa9db..e915e3c 100644 --- a/info.json +++ b/info.json @@ -15,7 +15,7 @@ "? Krastorio2", "? Krastorio2-spaced-out", "? Rich-Rocks-Requiem", - "? 248k", + "? 248k-Redux", "? tenebris", "? deadlock-beltboxes-loaders", "? DeadlockCrating" From 3d368bea905f6278787c74427c223b19fa86d0e0 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 11 Oct 2025 18:22:29 +0200 Subject: [PATCH 07/12] K2 fix --- lead-asteroid-updates.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lead-asteroid-updates.lua b/lead-asteroid-updates.lua index bb2ab06..79b64c9 100644 --- a/lead-asteroid-updates.lua +++ b/lead-asteroid-updates.lua @@ -22,7 +22,7 @@ if mods["space-age"] then {icon="__base__/graphics/icons/iron-ore.png", size=64, scale=0.25, shift={-8,0}}, {icon="__bzlead__/graphics/icons/lead-ore.png", size=64, scale=0.25, shift={8,0}}, }, - category = "crushing", + category = "kr-crushing", subgroup="space-crushing", order = "b-a-z-b", auto_recycle = false, From eabb69f95b2984bcf0d5ba9fbf4566a2a43fa7f8 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 13 Oct 2025 12:26:46 +0200 Subject: [PATCH 08/12] 248k renaming fix --- compatibility/248k.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility/248k.lua b/compatibility/248k.lua index 5e69008..1e0125f 100644 --- a/compatibility/248k.lua +++ b/compatibility/248k.lua @@ -3,7 +3,7 @@ local util = require("data-util"); local pb2 = "fu_lead_item" -if mods["248k"] then +if mods["248k-Redux"] then -- Swap out all 248k titanium for BZ titanium_plate for i, recipe in pairs(data.raw.recipe) do util.replace_ingredient(recipe.name, pb2, "lead-plate") From 01d55f3b620a60a0517d42b3d50e3d19d475a443 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 13 Oct 2025 17:36:09 +0200 Subject: [PATCH 09/12] Fix ingredients --- lead-recipe-se.lua | 2 +- lead-recipe-updates.lua | 2 +- lead-recipe.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lead-recipe-se.lua b/lead-recipe-se.lua index 16f8766..cf5b0a4 100644 --- a/lead-recipe-se.lua +++ b/lead-recipe-se.lua @@ -104,7 +104,7 @@ if mods["space-exploration"] then data.raw.recipe["enriched-lead-plate"].order= "d[lead-plate]" se_delivery_cannon_recipes["enriched-lead"] = {name= "enriched-lead"} else - if util.me.byproduct() then util.add_product("molten-lead", {"copper-ore", 6}) end + if util.me.byproduct() then util.add_product("molten-lead", { type = "item", name = "copper-ore", amount = 6 }) end end se_delivery_cannon_recipes["lead-ingot"] = {name="lead-ingot"} end \ No newline at end of file diff --git a/lead-recipe-updates.lua b/lead-recipe-updates.lua index 9a29d0b..e693144 100644 --- a/lead-recipe-updates.lua +++ b/lead-recipe-updates.lua @@ -282,7 +282,7 @@ util.add_ingredient("storehouse-basic", "lead-plate", 8) -- Leighzer's scrap if mods.leighzerscrapyards then util.add_to_product("scrap-processing", "iron-plate", -1) - util.add_product("scrap-processing", {"lead-plate", 1}) + util.add_product("scrap-processing", { type = "item", name = "lead-plate", amount = 1 }) end util.add_minable_result("simple-entity", "huge-volcanic-rock", {type="item", name="lead-ore", amount_min=10, amount_max=24}) diff --git a/lead-recipe.lua b/lead-recipe.lua index c2a7564..dbfda83 100644 --- a/lead-recipe.lua +++ b/lead-recipe.lua @@ -374,7 +374,7 @@ data:extend({ { enabled = true, energy_required = 16, - ingredients = {{"lead-ore", 10}}, + ingredients = {{ type = "item", name = "lead-ore", amount = 10 }}, results = { {type="item", name = "lead-ingot", amount_min=4, amount_max=5}, {type="item", name = "copper-ore", amount_min=1, amount_max=2}, @@ -383,7 +383,7 @@ data:extend({ { enabled = true, energy_required = 6.4, - ingredients = {{"lead-ore", 2}}, + ingredients = {{ type = "item", name = "lead-ore", amount = 2 }}, results = { {type="item", name = "lead-ingot", amount=2, probability=5/6}, {type="item", name = "copper-ore", amount=1, probability=1/3}, @@ -393,7 +393,7 @@ data:extend({ { enabled = true, energy_required = 12.8, - ingredients = {{"lead-ore", 4}}, + ingredients = {{ type = "item", name = "lead-ore", amount = 4 }}, results = { {type="item", name = "lead-ingot", amount=2, probability=5/6}, {type="item", name = "copper-ore", amount=2, probability=1/3}, From 90c296785c69a8db0cad972e7a08cead9b5ee7bd Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Mon, 13 Oct 2025 22:58:34 +0200 Subject: [PATCH 10/12] Fix name kr-iron-beam --- data-final-fixes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-final-fixes.lua b/data-final-fixes.lua index abe6676..e24546b 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -18,7 +18,7 @@ if util.k2() then local lead_bolt = util.me.more_entities() and "lead-expansion-bolt" or "lead-plate" util.replace_ingredient("kr-rifle-magazine", "iron-plate", "lead-plate") util.replace_ingredient("kr-anti-materiel-rifle-magazine", "iron-plate", "lead-plate") - util.replace_some_ingredient("kr-crusher", "iron-beam", 5, lead_bolt, 5) + util.replace_some_ingredient("kr-crusher", "kr-iron-beam", 5, lead_bolt, 5) util.replace_ingredient("kr-shelter", "iron-plate", lead_bolt) util.add_ingredient("kr-advanced-furnace", lead_bolt, 20) util.replace_ingredient("uranium-fuel-cell", "steel-plate", "lead-plate") From 9a10c1a2692bc00c4d2c7df71d36438748e6e0af Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Thu, 16 Oct 2025 00:24:35 +0200 Subject: [PATCH 11/12] Fix picture sizes --- lead-enriched.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lead-enriched.lua b/lead-enriched.lua index 7597222..26bc32f 100644 --- a/lead-enriched.lua +++ b/lead-enriched.lua @@ -11,10 +11,10 @@ data:extend( icon = "__bzlead__/graphics/icons/enriched-lead.png", icon_mipmaps = 3, pictures = { - {filename="__bzlead__/graphics/icons/enriched-lead.png", size=64, scale=0.25}, - {filename="__bzlead__/graphics/icons/enriched-lead-1.png", size=64, scale=0.25}, - {filename="__bzlead__/graphics/icons/enriched-lead-2.png", size=64, scale=0.25}, - {filename="__bzlead__/graphics/icons/enriched-lead-3.png", size=64, scale=0.25}, + {filename="__bzlead__/graphics/icons/enriched-lead.png", size=64, scale=0.5}, + {filename="__bzlead__/graphics/icons/enriched-lead-1.png", size=64, scale=0.5}, + {filename="__bzlead__/graphics/icons/enriched-lead-2.png", size=64, scale=0.5}, + {filename="__bzlead__/graphics/icons/enriched-lead-3.png", size=64, scale=0.5}, }, subgroup = "raw-material", order = "e05-a[enriched-ores]-a1[enriched-lead]", From d968cc1ef1593b038a3af1a84d2f665fca3a11ed Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 18 Oct 2025 22:14:02 +0200 Subject: [PATCH 12/12] Fix SA compatibility --- lead-asteroid-updates.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lead-asteroid-updates.lua b/lead-asteroid-updates.lua index 79b64c9..bb2ab06 100644 --- a/lead-asteroid-updates.lua +++ b/lead-asteroid-updates.lua @@ -22,7 +22,7 @@ if mods["space-age"] then {icon="__base__/graphics/icons/iron-ore.png", size=64, scale=0.25, shift={-8,0}}, {icon="__bzlead__/graphics/icons/lead-ore.png", size=64, scale=0.25, shift={8,0}}, }, - category = "kr-crushing", + category = "crushing", subgroup="space-crushing", order = "b-a-z-b", auto_recycle = false,