Compare commits

...
Sign in to create a new pull request.

4 commits
main ... main

Author SHA1 Message Date
Simon Brodtmann
9c1051112c 2.0.4 2025-11-01 23:06:10 +01:00
pla
cd771d5e0c Fix K2 matter recipes and tech (#2)
![image](/attachments/3ad3274d-1933-469b-9eb9-caeca53e5a4a)

Co-authored-by: pla
Reviewed-on: cacklingfiend/Indium2#2
Co-authored-by: pla <pla@noreply.example.org>
Co-committed-by: pla <pla@noreply.example.org>
2025-11-01 12:56:40 +01:00
Simon Brodtmann
be3de186f2 Fix booleans being strings 2025-11-01 12:48:24 +01:00
pla
29eed595fa 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: cacklingfiend/Indium2#1
Co-authored-by: pla
Co-committed-by: pla
2025-11-01 12:48:24 +01:00
8 changed files with 53 additions and 24 deletions

View file

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

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)
@ -855,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 :|

View file

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

@ -1,5 +1,6 @@
[technology-name]
indium-processing=Indium processing
indium-matter-processing=Indium conversion
indium-pcb-solder=Indium pcb solder
[technology-description]

View file

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

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