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: #1
Co-authored-by: pla
Co-committed-by: pla
This commit is contained in:
pla 2025-11-01 12:41:07 +01:00 committed by Simon Brodtmann
parent cd6f596dca
commit 29eed595fa
5 changed files with 33 additions and 13 deletions

View file

@ -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)

View file

@ -10,10 +10,15 @@
"base >= 2.0.0",
"? bismuth",
"? BrassTacks-Updated",
"? bzcarbon",
"? bzcarbon2",
"? bzfoundry",
"? bzfoundry2",
"? bzlead",
"? bzlead2",
"? bzsilicon",
"? bzsilicon2",
"? bztin",
"? bztin2",
"? IfNickel-Updated",
"? Krastorio2",

View file

@ -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}},
}
})

View file

@ -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"},

View file

@ -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