mirror of
https://github.com/minetest-mods/technic.git
synced 2024-09-27 15:00:18 +02:00
Add additional check for nether (to make sure that we have the right one)
This commit is contained in:
parent
0bf4066d2b
commit
fd34254c9c
|
@ -8,6 +8,18 @@ function technic.register_grinder_recipe(data)
|
||||||
technic.register_recipe("grinding", data)
|
technic.register_recipe("grinding", data)
|
||||||
end
|
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 = {
|
local recipes = {
|
||||||
-- Dusts
|
-- Dusts
|
||||||
{"default:coal_lump", "technic:coal_dust 2"},
|
{"default:coal_lump", "technic:coal_dust 2"},
|
||||||
|
@ -73,7 +85,7 @@ local dependent_recipes = {
|
||||||
}
|
}
|
||||||
|
|
||||||
for dependency, materials_to_add in pairs(dependent_recipes) do
|
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
|
for _, material_entry in ipairs(materials_to_add) do
|
||||||
table.insert(recipes, material_entry)
|
table.insert(recipes, material_entry)
|
||||||
end
|
end
|
||||||
|
@ -159,7 +171,7 @@ local dependent_dusts = {
|
||||||
}
|
}
|
||||||
|
|
||||||
for dependency, dusts_to_add in pairs(dependent_dusts) do
|
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
|
for _, dust_entry in pairs(dusts_to_add) do
|
||||||
table.insert(dusts, dust_entry)
|
table.insert(dusts, dust_entry)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user