From 50c84220f826373af6550183f29fb6fcf7386075 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Thu, 16 Oct 2025 17:34:38 +0200 Subject: [PATCH] Krastorio2: Compatibility fixes --- Bio_Industries_2/data-updates.lua | 8 +++++--- .../prototypes/Bio_Farm/compatible_recipes.lua | 10 ++++++---- Bio_Industries_2/prototypes/Bio_Farm/recipe.lua | 9 ++++----- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Bio_Industries_2/data-updates.lua b/Bio_Industries_2/data-updates.lua index 3dbb334..604c407 100644 --- a/Bio_Industries_2/data-updates.lua +++ b/Bio_Industries_2/data-updates.lua @@ -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 diff --git a/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua b/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua index c04abec..d19a894 100644 --- a/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua +++ b/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua @@ -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 diff --git a/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua b/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua index 33bc7c8..7e7f32f 100644 --- a/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua +++ b/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua @@ -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 = {