forked from minetest-mods/moreblocks
Check for ndef before registering Stairs+ nodes.
This commit is contained in:
parent
5e0201968e
commit
aef4413eb9
@ -35,24 +35,26 @@ local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
|||||||
for _, name in pairs(default_nodes) do
|
for _, name in pairs(default_nodes) do
|
||||||
local nodename = "default:" .. name
|
local nodename = "default:" .. name
|
||||||
local ndef = minetest.registered_nodes[nodename]
|
local ndef = minetest.registered_nodes[nodename]
|
||||||
local groups = {}
|
if ndef then
|
||||||
for k, v in pairs(ndef.groups)
|
local groups = {}
|
||||||
-- Ignore wood and stone groups to not make them usable in crafting:
|
for k, v in pairs(ndef.groups)
|
||||||
do if k ~= "wood" and k ~= "stone" then
|
-- Ignore wood and stone groups to not make them usable in crafting:
|
||||||
groups[k] = v
|
do if k ~= "wood" and k ~= "stone" then
|
||||||
|
groups[k] = v
|
||||||
|
end
|
||||||
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
|
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
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user