Make the wool dependency optional
The mod needs the wool and default mods only for the crafting recipes. By registering the recipes only if the required nodes exist, the mod is installable even without minetest_game or a similar game.
This commit is contained in:
parent
3869e3f3cc
commit
6ba6493049
29
init.lua
29
init.lua
@ -31,14 +31,16 @@ for s,l in pairs(colours) do
|
||||
groups = {oddly_breakable_by_hand=3,snappy=2,choppy=2},
|
||||
sounds = dog_sounds,
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = name.." 6",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{input, input, input},
|
||||
{input, input, input},
|
||||
}
|
||||
})
|
||||
if minetest.registered_nodes[input] then
|
||||
minetest.register_craft({
|
||||
output = name.." 6",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{input, input, input},
|
||||
{input, input, input},
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -116,10 +118,13 @@ for dog,data in pairs(dogs) do
|
||||
end
|
||||
end,
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = name.." 6",
|
||||
recipe = recipe
|
||||
})
|
||||
if minetest.registered_nodes["wool:white"]
|
||||
and minetest.registered_nodes["default:torch"] then
|
||||
minetest.register_craft({
|
||||
output = name.." 6",
|
||||
recipe = recipe
|
||||
})
|
||||
end
|
||||
minetest.register_abm({
|
||||
nodenames = {name},
|
||||
interval = 1.5,
|
||||
|
Loading…
x
Reference in New Issue
Block a user