Check for ndef before registering Stairs+ nodes.

This commit is contained in:
Calinou 2015-02-11 17:59:28 +01:00
parent 5e0201968e
commit aef4413eb9
1 changed files with 19 additions and 17 deletions

View File

@ -35,24 +35,26 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks:
for _, name in pairs(default_nodes) do
local nodename = "default:" .. name
local ndef = minetest.registered_nodes[nodename]
local groups = {}
for k, v in pairs(ndef.groups)
-- Ignore wood and stone groups to not make them usable in crafting:
do if k ~= "wood" and k ~= "stone" then
groups[k] = v
if ndef then
local groups = {}
for k, v in pairs(ndef.groups)
-- Ignore wood and stone groups to not make them usable in crafting:
do if k ~= "wood" and k ~= "stone" then
groups[k] = v
end
end
local drop
if type(ndef.drop) == "string" then
drop = ndef.drop:sub(9)
end
stairsplus:register_all("moreblocks", name, nodename, {
description = ndef.description,
drop = drop,
groups = groups,
sounds = ndef.sounds,
tiles = ndef.tiles,
sunlight_propagates = true,
})
end
local drop
if type(ndef.drop) == "string" then
drop = ndef.drop:sub(9)
end
stairsplus:register_all("moreblocks", name, nodename, {
description = ndef.description,
drop = drop,
groups = groups,
sounds = ndef.sounds,
tiles = ndef.tiles,
sunlight_propagates = true,
})
end