Only use default sounds if default mod is present
This commit is contained in:
parent
3d3c598103
commit
1264daae8f
8
init.lua
8
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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user