From 1264daae8fd36b12f0feaaed94c3068d16ae356f Mon Sep 17 00:00:00 2001 From: ezhh Date: Sat, 7 Jul 2018 11:23:21 +0100 Subject: [PATCH] Only use default sounds if default mod is present --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ea745b9..d0d461e 100644 --- a/init.lua +++ b/init.lua @@ -4,6 +4,11 @@ local hedges = {} function hedges.register_hedge(name, def) -- register node + + if minetest.get_modpath("default") then + def.sounds = def.sounds or default.node_sound_leaves_defaults() + end + minetest.register_node(name, { description = def.description or "Hedge", drawtype = "nodebox", @@ -22,7 +27,7 @@ function hedges.register_hedge(name, def) }, connects_to = {"group:fence", "group:wood", "group:tree", "group:hedge"}, light_source = def.light_source or 0, - sounds = def.sounds or default.node_sound_leaves_defaults(), + sounds = def.sounds }) -- register crafting recipe @@ -71,6 +76,7 @@ if minetest.get_modpath("default") then end + -- alternative recipes using bush leaves minetest.register_craft({ output = "hedges:apple_hedge 4",