aboutsummaryrefslogtreecommitdiff
path: root/stairsplus
diff options
context:
space:
mode:
authorCalinou <calinou@opmbx.org>2015-02-11 17:59:28 +0100
committerCalinou <calinou@opmbx.org>2015-02-11 17:59:28 +0100
commitaef4413eb9ed1146200793ed8b23cfae0493af40 (patch)
tree4a216b5c68554deba3c530617b92dcc2ec3b3a28 /stairsplus
parent5e0201968e18d6fe614801e88a8ee960a976377a (diff)
downloadmoreblocks-aef4413eb9ed1146200793ed8b23cfae0493af40.tar.gz
moreblocks-aef4413eb9ed1146200793ed8b23cfae0493af40.tar.bz2
moreblocks-aef4413eb9ed1146200793ed8b23cfae0493af40.zip
Check for ndef before registering Stairs+ nodes.
Diffstat (limited to 'stairsplus')
-rw-r--r--stairsplus/registrations.lua36
1 files changed, 19 insertions, 17 deletions
diff --git a/stairsplus/registrations.lua b/stairsplus/registrations.lua
index 7b38b13..c6111c4 100644
--- a/stairsplus/registrations.lua
+++ b/stairsplus/registrations.lua
@@ -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