From 1f9e86c3da08acb9e63e07c980a19097f6a125e2 Mon Sep 17 00:00:00 2001 From: "Maksym H." Date: Thu, 2 Jan 2025 10:19:16 +0100 Subject: [PATCH] Make the detector recipe from luacontroller optional (#696) --- mesecons_detector/init.lua | 36 ++++++++++++++++++++---------------- mesecons_detector/mod.conf | 1 + 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/mesecons_detector/init.lua b/mesecons_detector/init.lua index 2653174..354f3dc 100644 --- a/mesecons_detector/init.lua +++ b/mesecons_detector/init.lua @@ -111,14 +111,16 @@ minetest.register_node("mesecons_detector:object_detector_on", { on_blast = mesecon.on_blastnode, }) -minetest.register_craft({ - output = 'mesecons_detector:object_detector_off', - recipe = { - {"mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot"}, - {"mesecons_gamecompat:steel_ingot", "mesecons_luacontroller:luacontroller0000", "mesecons_gamecompat:steel_ingot"}, - {"mesecons_gamecompat:steel_ingot", "group:mesecon_conductor_craftable", "mesecons_gamecompat:steel_ingot"}, - } -}) +if minetest.get_modpath("mesecons_luacontroller") then + minetest.register_craft({ + output = 'mesecons_detector:object_detector_off', + recipe = { + {"mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot"}, + {"mesecons_gamecompat:steel_ingot", "mesecons_luacontroller:luacontroller0000", "mesecons_gamecompat:steel_ingot"}, + {"mesecons_gamecompat:steel_ingot", "group:mesecon_conductor_craftable", "mesecons_gamecompat:steel_ingot"}, + } + }) +end minetest.register_craft({ output = 'mesecons_detector:object_detector_off', @@ -287,14 +289,16 @@ minetest.register_node("mesecons_detector:node_detector_on", { on_blast = mesecon.on_blastnode, }) -minetest.register_craft({ - output = 'mesecons_detector:node_detector_off', - recipe = { - {"mesecons_gamecompat:steel_ingot", "group:mesecon_conductor_craftable", "mesecons_gamecompat:steel_ingot"}, - {"mesecons_gamecompat:steel_ingot", "mesecons_luacontroller:luacontroller0000", "mesecons_gamecompat:steel_ingot"}, - {"mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot"}, - } -}) +if minetest.get_modpath("mesecons_luacontroller") then + minetest.register_craft({ + output = 'mesecons_detector:node_detector_off', + recipe = { + {"mesecons_gamecompat:steel_ingot", "group:mesecon_conductor_craftable", "mesecons_gamecompat:steel_ingot"}, + {"mesecons_gamecompat:steel_ingot", "mesecons_luacontroller:luacontroller0000", "mesecons_gamecompat:steel_ingot"}, + {"mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot", "mesecons_gamecompat:steel_ingot"}, + } + }) +end minetest.register_craft({ output = 'mesecons_detector:node_detector_off', diff --git a/mesecons_detector/mod.conf b/mesecons_detector/mod.conf index 6d5a0e6..ee5611b 100644 --- a/mesecons_detector/mod.conf +++ b/mesecons_detector/mod.conf @@ -1,2 +1,3 @@ name = mesecons_detector depends = mesecons, mesecons_gamecompat, mesecons_materials +optional_depends = mesecons_luacontroller