Krastorio2: Compatibility fixes

This commit is contained in:
Simon Brodtmann 2025-10-16 17:34:38 +02:00
parent dc32c012ba
commit 50c84220f8
3 changed files with 15 additions and 12 deletions

View file

@ -429,7 +429,7 @@ end
-- We only want to create nitrogen if it doesn't exist yet. We then also need to create
-- liquid air.
if not data.raw.fluid["nitrogen"] then
if not data.raw.fluid["nitrogen"] and not data.raw.fluid["kr-nitrogen"] then
data:extend({
{
type = "fluid",
@ -488,6 +488,8 @@ if not data.raw.fluid["nitrogen"] then
-- Recipes for "bi-liquid-air" and "bi-nitrogen" aren't needed!
else
local nitrogen = mods["Krastorio2"] and "kr-nitrogen" or "nitrogen"
-- Remove recipe unlocks
thxbob.lib.tech.remove_recipe_unlock("bi-tech-fertilizer", "bi-liquid-air")
thxbob.lib.tech.remove_recipe_unlock("bi-tech-fertilizer", "bi-nitrogen")
@ -500,8 +502,8 @@ else
BioInd.writeDebug("Replaced \"liquid-air\" with \"oxygen\" in recipes \"bi-biomass-2\" and \"bi-biomass-3\"")
-- Perhaps there is no oxygen? But there's nitrogen for sure, so we fall back to that!
elseif data.raw.fluid.nitrogen then
thxbob.lib.recipe.replace_ingredient("bi-biomass-2", "liquid-air", "nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-biomass-3", "liquid-air", "nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-biomass-2", "liquid-air", nitrogen)
thxbob.lib.recipe.replace_ingredient("bi-biomass-3", "liquid-air", nitrogen)
BioInd.writeDebug("Replaced \"liquid-air\" with \"nitrogen\" in recipes \"bi-biomass-2\" and \"bi-biomass-3\"")
end

View file

@ -5,6 +5,8 @@ local ICONPATH_AAI = BioInd.modRoot .. "/graphics/icons/mod_aai/"
local ICONPATH_KR = BioInd.modRoot .. "/graphics/icons/mod_krastorio/"
local ICONPATHMIPS = BioInd.modRoot .. "/graphics/icons/mips/"
local nitrogen = mods["Krastorio2"] and "kr-nitrogen" or "nitrogen"
data:extend({
{
type = "recipe",
@ -44,7 +46,7 @@ data:extend({
category = "chemistry",
energy_required = 5,
ingredients = {
{type = "fluid", name = "nitrogen", amount = 10},
{type = "fluid", name = nitrogen, amount = 10},
{type = "item", name = "bi-ash", amount = 10}
},
results = {
@ -186,7 +188,7 @@ end
--- Add fertilizer recipes if bob's or Angels
if data.raw.item["solid-sodium-hydroxide"] and mods["angelspetrochem"] then
thxbob.lib.recipe.add_new_ingredient("bi-fertilizer-2", {type = "item", name = "solid-sodium-hydroxide", amount = 10})
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", "nitrogen", "gas-nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", nitrogen, "gas-nitrogen")
data.raw.recipe["bi-fertilizer-2"].icon = ICONPATH_BA .. "fertilizer_solid_sodium_hydroxide.png"
data.raw.recipe["bi-fertilizer-2"].icon_size = 64
thxbob.lib.tech.add_recipe_unlock("bi-tech-fertilizer", "bi-fertilizer-2")
@ -202,8 +204,8 @@ end
-- If Angels, replace liquid air + nitrogen and with Angel's ingredients in recipes
if data.raw.fluid["gas-nitrogen"] and data.raw.fluid["gas-compressed-air"] and mods["angelspetrochem"] then
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-1", "nitrogen", "gas-nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", "nitrogen", "gas-nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-1", nitrogen, "gas-nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", nitrogen, "gas-nitrogen")
thxbob.lib.recipe.replace_ingredient("bi-biomass-2", "liquid-air", "gas-compressed-air")
thxbob.lib.recipe.replace_ingredient("bi-biomass-3", "liquid-air", "gas-compressed-air")
end

View file

@ -2,12 +2,11 @@ local BioInd = require('common')('Bio_Industries_2')
local ICONPATH = BioInd.modRoot .. "/graphics/icons/"
local ICONPATH_W = BioInd.modRoot .. "/graphics/icons/weapons/"
local ICONPATH_E = BioInd.modRoot .. "/graphics/icons/entity/"
local ICONPATHMIPS = BioInd.modRoot .. "/graphics/icons/mips/"
local nitrogen = mods["Krastorio2"] and "kr-nitrogen" or "nitrogen"
data:extend({
--- Seeds from Water (BASIC)
{
type = "recipe",
@ -1141,7 +1140,7 @@ data:extend({
{ type = "fluid", name = "liquid-air", amount = 20 }
},
results = {
{ type = "fluid", name = "nitrogen", amount = 20 },
{ type = "fluid", name = nitrogen, amount = 20 },
},
crafting_machine_tint = {
primary = { r = 0.0, g = 0.8, b = 0.0, a = 0.000 },
@ -1173,7 +1172,7 @@ data:extend({
energy_required = 5,
ingredients = {
{ type = "item", name = "sulfur", amount = 1 },
{ type = "fluid", name = "nitrogen", amount = 10 },
{ type = "fluid", name = nitrogen, amount = 10 },
{ type = "item", name = "bi-ash", amount = 10 }
},
results = {