From b2c129984c60f7ed8651dab31d3b281c5e1ecf38 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 15 Feb 2017 03:48:03 +0100 Subject: [PATCH] Declare optional dependencies --- depends.txt | 3 ++- init.lua | 53 ++++++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/depends.txt b/depends.txt index 6d0fae9..d84623a 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ mesecons -doc +doc? +default? diff --git a/init.lua b/init.lua index b26ed0c..6a1d989 100644 --- a/init.lua +++ b/init.lua @@ -170,31 +170,34 @@ minetest.register_node("mesecons_window:filter2_open", { end }) +if minetest.get_modpath("default") then + minetest.register_craft({ + output = 'mesecons_window:window_closed', + recipe = { + {"", "default:glass", ""}, + {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, + } + }) -minetest.register_craft({ - output = 'mesecons_window:window_closed', - recipe = { - {"", "default:glass", ""}, - {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, - } -}) + minetest.register_craft({ + output = 'mesecons_window:filter_closed', + recipe = { + {"", "default:pine_needles", ""}, + {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, + } + }) -minetest.register_craft({ - output = 'mesecons_window:filter_closed', - recipe = { - {"", "default:pine_needles", ""}, - {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, - } -}) + minetest.register_craft({ + output = 'mesecons_window:filter2_closed', + recipe = { + {"", "default:glass", ""}, + {"default:pine_needles", "group:mesecon_conductor_craftable", "default:pine_needles"}, + } + }) +end -minetest.register_craft({ - output = 'mesecons_window:filter2_closed', - recipe = { - {"", "default:glass", ""}, - {"default:pine_needles", "group:mesecon_conductor_craftable", "default:pine_needles"}, - } -}) - -doc.add_entry_alias("nodes", "mesecons_window:window_closed", "nodes", "mesecons_window:window_open") -doc.add_entry_alias("nodes", "mesecons_window:filter_closed", "nodes", "mesecons_window:filter_open") -doc.add_entry_alias("nodes", "mesecons_window:filter2_closed", "nodes", "mesecons_window:filter2_open") +if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mesecons_window:window_closed", "nodes", "mesecons_window:window_open") + doc.add_entry_alias("nodes", "mesecons_window:filter_closed", "nodes", "mesecons_window:filter_open") + doc.add_entry_alias("nodes", "mesecons_window:filter2_closed", "nodes", "mesecons_window:filter2_open") +end