From 1600710d2861969811eb4cf82878af85da9ad6b2 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 18 Oct 2025 21:38:41 +0200 Subject: [PATCH] Fix mod compatibilities --- Bio_Industries_2/data-updates.lua | 14 ++++++-------- .../prototypes/Bio_Farm/compatible_recipes.lua | 6 +++--- Bio_Industries_2/prototypes/Bio_Farm/recipe.lua | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Bio_Industries_2/data-updates.lua b/Bio_Industries_2/data-updates.lua index 9284b6a..99dd0a5 100644 --- a/Bio_Industries_2/data-updates.lua +++ b/Bio_Industries_2/data-updates.lua @@ -488,8 +488,8 @@ if not data.raw.fluid["nitrogen"] and not data.raw.fluid["kr-nitrogen"] then -- Recipes for "bi-liquid-air" and "bi-nitrogen" aren't needed! else - local oxygen = mods["Krastorio2"] and "kr-oxygen" or "oxygen" - local nitrogen = mods["Krastorio2"] and "kr-nitrogen" or "nitrogen" + local oxygen = data.raw.fluid["kr-oxygen"] and "kr-oxygen" or "oxygen" + local nitrogen = data.raw.fluid["kr-nitrogen"] and "kr-nitrogen" or "nitrogen" -- Remove recipe unlocks thxbob.lib.tech.remove_recipe_unlock("bi-tech-fertilizer", "bi-liquid-air") @@ -515,20 +515,18 @@ else end - - -- Replace nitrogen (BI) with bob-nitrogen (Bob's) in recipe "bi-nitrogen" if data.raw.fluid["bob-nitrogen"] then - - thxbob.lib.recipe.remove_result("bi-nitrogen", "nitrogen") + local nitrogen = data.raw.fluid["kr-nitrogen"] and "kr-nitrogen" or "nitrogen" + thxbob.lib.recipe.remove_result("bi-nitrogen", nitrogen) thxbob.lib.recipe.add_result("bi-nitrogen", { type = "fluid", name = "bob-nitrogen", amount = 40 }) - thxbob.lib.recipe.replace_ingredient("bi-fertilizer-1", "nitrogen", "bob-nitrogen") - thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", "nitrogen", "bob-nitrogen") + thxbob.lib.recipe.replace_ingredient("bi-fertilizer-1", nitrogen, "bob-nitrogen") + thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", nitrogen, "bob-nitrogen") BioInd.writeDebug("Update nitrogen compatibility for Bob's") diff --git a/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua b/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua index d19a894..41961f2 100644 --- a/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua +++ b/Bio_Industries_2/prototypes/Bio_Farm/compatible_recipes.lua @@ -5,7 +5,7 @@ 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" +local nitrogen = data.raw.fluid["kr-nitrogen"] and "kr-nitrogen" or "nitrogen" data:extend({ { @@ -381,7 +381,7 @@ end -- Add recipe for sand from crushed stone if any other mod provides sand -if data.raw.item[mods["Krastorio2"] and "kr-sand" or "sand"] or +if data.raw.item[data.raw.item["kr-sand"] and "kr-sand" or "sand"] or data.raw.item["biotech-sand"] or data.raw.item["solid-sand"] then @@ -403,7 +403,7 @@ if data.raw.item[mods["Krastorio2"] and "kr-sand" or "sand"] or order = "a[bi]-a-z[bi-9-sand]", energy_required = 1, ingredients = {{type="item", name="stone-crushed", amount=2}}, - results = {{type="item", name=mods["Krastorio2"] and "kr-sand" or "sand", amount=5}}, + results = {{type="item", name=data.raw.item["kr-sand"] and "kr-sand" or "sand", amount=5}}, main_product = "", enabled = false, allow_as_intermediate = true, -- Changed for 0.18.34/1.1.4 diff --git a/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua b/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua index 7e7f32f..a317852 100644 --- a/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua +++ b/Bio_Industries_2/prototypes/Bio_Farm/recipe.lua @@ -3,7 +3,7 @@ local ICONPATH = BioInd.modRoot .. "/graphics/icons/" local ICONPATH_W = BioInd.modRoot .. "/graphics/icons/weapons/" local ICONPATH_E = BioInd.modRoot .. "/graphics/icons/entity/" -local nitrogen = mods["Krastorio2"] and "kr-nitrogen" or "nitrogen" +local nitrogen = data.raw.fluid["kr-nitrogen"] and "kr-nitrogen" or "nitrogen" data:extend({