From fd34254c9c394100547a8704324ca4eb4d87ae3e Mon Sep 17 00:00:00 2001 From: gabriel1379 Date: Sat, 13 Apr 2024 21:23:19 +0200 Subject: [PATCH] Add additional check for nether (to make sure that we have the right one) --- technic/machines/register/grinder_recipes.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/technic/machines/register/grinder_recipes.lua b/technic/machines/register/grinder_recipes.lua index c0e5540..493227e 100644 --- a/technic/machines/register/grinder_recipes.lua +++ b/technic/machines/register/grinder_recipes.lua @@ -8,6 +8,18 @@ function technic.register_grinder_recipe(data) technic.register_recipe("grinding", data) end +-- Function for cases where multiple mods exist with the same name, +-- to check if we have the right one. +local function is_right_mod(dependency) + local is_right = true + + if dependency == "nether" then + is_right = minetest.registered_nodes["nether:brick_compressed"] ~= nil + end + + return is_right +end + local recipes = { -- Dusts {"default:coal_lump", "technic:coal_dust 2"}, @@ -73,7 +85,7 @@ local dependent_recipes = { } for dependency, materials_to_add in pairs(dependent_recipes) do - if minetest.get_modpath(dependency) then + if minetest.get_modpath(dependency) and is_right_mod(dependency) then for _, material_entry in ipairs(materials_to_add) do table.insert(recipes, material_entry) end @@ -159,7 +171,7 @@ local dependent_dusts = { } for dependency, dusts_to_add in pairs(dependent_dusts) do - if minetest.get_modpath(dependency) then + if minetest.get_modpath(dependency) and is_right_mod(dependency) then for _, dust_entry in pairs(dusts_to_add) do table.insert(dusts, dust_entry) end