From 3983ade96e774e113825f2b33869d40e54fa8d00 Mon Sep 17 00:00:00 2001 From: pla Date: Sat, 25 Oct 2025 20:55:43 +0200 Subject: [PATCH 1/3] Fix K2 matter recipe generation and tech icon --- bzaluminum2/aluminum-matter.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bzaluminum2/aluminum-matter.lua b/bzaluminum2/aluminum-matter.lua index 92caa5c..153cf29 100644 --- a/bzaluminum2/aluminum-matter.lua +++ b/bzaluminum2/aluminum-matter.lua @@ -1,6 +1,6 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then -local util = require("data-util"); +local util = require("data-util") local matter = require("__Krastorio2__/prototypes/libraries/matter") data:extend( @@ -11,15 +11,16 @@ data:extend( icons = { { - icon = util.k2assets().."/technologies/matter-coal.png", + icon = util.k2assets().."/technologies/backgrounds/matter.png", icon_size = 256, }, { icon = "__bzaluminum2__/graphics/icons/aluminum-ore.png", icon_size = 64, - scale = 1.4, + scale = 1, } }, + effects = {}, prerequisites = {"kr-matter-processing"}, unit = { @@ -40,8 +41,8 @@ local aluminum_ore_matter = material = { type = "item", name = "aluminum-ore", amount = 10 }, matter_count = 5, energy_required = 1, - need_stabilizer = false, - unlocked_by_technology = "aluminum-matter-processing" + needs_stabilizer = false, + unlocked_by = "aluminum-matter-processing" } matter.make_recipes(aluminum_ore_matter) @@ -51,8 +52,8 @@ local alumina_matter = matter_count = 7.5, energy_required = 2, only_deconversion = true, - need_stabilizer = true, - unlocked_by_technology = "aluminum-matter-processing" + needs_stabilizer = true, + unlocked_by = "aluminum-matter-processing" } matter.make_recipes(alumina_matter) local aluminum_plate_matter = @@ -61,8 +62,8 @@ local aluminum_plate_matter = matter_count = 10, energy_required = 3, only_deconversion = true, - need_stabilizer = true, - unlocked_by_technology = "aluminum-matter-processing" + needs_stabilizer = true, + unlocked_by = "aluminum-matter-processing" } matter.make_recipes(aluminum_plate_matter) end -- 2.39.5 From d2f64e768deff1c5de49485debd545ba4b93ee8c Mon Sep 17 00:00:00 2001 From: pla Date: Sat, 25 Oct 2025 21:10:18 +0200 Subject: [PATCH 2/3] Forgot to fix the lib function --- bzaluminum2/data-util.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bzaluminum2/data-util.lua b/bzaluminum2/data-util.lua index e69f0d5..2270a10 100644 --- a/bzaluminum2/data-util.lua +++ b/bzaluminum2/data-util.lua @@ -115,12 +115,12 @@ end function util.k2matter(params) local matter = require("__Krastorio2__/prototypes/libraries/matter") if mods["space-exploration"] then - params.k2matter.need_stabilizer = true + params.k2matter.needs_stabilizer = true end if not params.k2matter.minimum_conversion_quantity then params.k2matter.minimum_conversion_quantity = 10 end - if not data.raw.technology[params.k2matter.unlocked_by_technology] then + if not data.raw.technology[params.k2matter.unlocked_by] then local icon = "" if params.k2baseicon then icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png" @@ -132,7 +132,7 @@ function util.k2matter(params) { { type = "technology", - name = params.k2matter.unlocked_by_technology, + name = params.k2matter.unlocked_by, icons = { { @@ -163,6 +163,7 @@ function util.k2matter(params) }, time = 45, }, + effects = {}, localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, }, }) -- 2.39.5 From fc5d728cbda6f046ec457b5059f67a231ec0cb7f Mon Sep 17 00:00:00 2001 From: pla Date: Mon, 27 Oct 2025 17:09:40 +0100 Subject: [PATCH 3/3] Fi K2 matter deconversion only for plate and alumina --- bzaluminum2/aluminum-matter.lua | 95 +++++++++++++++------------------ bzaluminum2/data-util.lua | 6 ++- 2 files changed, 49 insertions(+), 52 deletions(-) diff --git a/bzaluminum2/aluminum-matter.lua b/bzaluminum2/aluminum-matter.lua index 153cf29..bacd77f 100644 --- a/bzaluminum2/aluminum-matter.lua +++ b/bzaluminum2/aluminum-matter.lua @@ -1,69 +1,62 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then -local util = require("data-util") -local matter = require("__Krastorio2__/prototypes/libraries/matter") + local util = require("data-util") + local matter = require("__Krastorio2__/prototypes/libraries/matter") -data:extend( -{ - { - type = "technology", - name = "aluminum-matter-processing", - icons = + data:extend({ { - { - icon = util.k2assets().."/technologies/backgrounds/matter.png", - icon_size = 256, + type = "technology", + name = "aluminum-matter-processing", + icons = { + { + icon = util.k2assets() .. "/technologies/backgrounds/matter.png", + icon_size = 256, + }, + { + icon = "__bzaluminum2__/graphics/icons/aluminum-ore.png", + icon_size = 64, + scale = 1, + }, + }, + effects = {}, + prerequisites = { "kr-matter-processing" }, + unit = { + count = 350, + ingredients = { + { "production-science-pack", 1 }, + { "utility-science-pack", 1 }, + { "kr-matter-tech-card", 1 }, + }, + time = 45, }, - { - icon = "__bzaluminum2__/graphics/icons/aluminum-ore.png", - icon_size = 64, - scale = 1, - } }, - effects = {}, - prerequisites = {"kr-matter-processing"}, - unit = - { - count = 350, - ingredients = - { - {"production-science-pack", 1}, - {"utility-science-pack", 1}, - {"kr-matter-tech-card", 1} - }, - time = 45 - } - }, -}) + }) -local aluminum_ore_matter = - { - material = { type = "item", name = "aluminum-ore", amount = 10 }, + local aluminum_ore_matter = { + material = { type = "item", name = "aluminum-ore", amount = 10 }, matter_count = 5, energy_required = 1, needs_stabilizer = false, - unlocked_by = "aluminum-matter-processing" - } -matter.make_recipes(aluminum_ore_matter) + unlocked_by = "aluminum-matter-processing", + } + matter.make_recipes(aluminum_ore_matter) -local alumina_matter = - { - material = { type = "item", name = "alumina", amount = 10 }, + local alumina_matter = { + material = { type = "item", name = "alumina", amount = 10 }, matter_count = 7.5, energy_required = 2, - only_deconversion = true, + -- only_deconversion = true, needs_stabilizer = true, - unlocked_by = "aluminum-matter-processing" - } -matter.make_recipes(alumina_matter) -local aluminum_plate_matter = - { - material = { type = "item", name = "aluminum-plate", amount = 10 }, + unlocked_by = "aluminum-matter-processing", + } + matter.make_deconversion_recipe(alumina_matter) + local aluminum_plate_matter = { + material = { type = "item", name = "aluminum-plate", amount = 10 }, matter_count = 10, energy_required = 3, - only_deconversion = true, + -- only_deconversion = true, needs_stabilizer = true, - unlocked_by = "aluminum-matter-processing" - } -matter.make_recipes(aluminum_plate_matter) + unlocked_by = "aluminum-matter-processing", + } + matter.make_deconversion_recipe(aluminum_plate_matter) end diff --git a/bzaluminum2/data-util.lua b/bzaluminum2/data-util.lua index 2270a10..fe2226b 100644 --- a/bzaluminum2/data-util.lua +++ b/bzaluminum2/data-util.lua @@ -168,7 +168,11 @@ function util.k2matter(params) }, }) end - matter.make_recipes(params.k2matter) + if params.k2matter.only_deconversion then + matter.make_deconversion_recipe(params.k2matter) + else + matter.make_recipes(params.k2matter) + end end -- 2.39.5