moreblocks/stairsplus/registrations.lua

77 lines
1.5 KiB
Lua
Raw Normal View History

--[[
2015-01-12 17:46:22 +01:00
More Blocks: registrations
2017-02-19 13:35:16 +01:00
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
2014-03-09 10:38:18 +01:00
"stone",
"stone_block",
2014-03-09 10:38:18 +01:00
"cobble",
"mossycobble",
"brick",
"sandstone",
"steelblock",
"goldblock",
"copperblock",
"bronzeblock",
"diamondblock",
"desert_stone",
"desert_stone_block",
2014-10-28 22:12:40 +01:00
"desert_cobble",
2015-06-17 17:18:17 +02:00
"meselamp",
2014-03-09 10:38:18 +01:00
"glass",
"tree",
"wood",
"jungletree",
"junglewood",
"pine_tree",
"pine_wood",
"acacia_tree",
"acacia_wood",
"aspen_tree",
"aspen_wood",
2014-03-09 10:38:18 +01:00
"obsidian",
"obsidian_block",
"obsidianbrick",
2014-03-09 10:38:18 +01:00
"obsidian_glass",
"stonebrick",
"desert_stonebrick",
"sandstonebrick",
"sandstone_block",
"coral_skeleton",
"farming:straw"
2014-03-09 10:38:18 +01:00
}
for _, name in pairs(default_nodes) do
local nodename = "default:"..name
local a,b = string.find(name, ":")
if b then
nodename = name
name = string.sub(name, b+1)
end
2014-03-09 10:38:18 +01:00
local ndef = minetest.registered_nodes[nodename]
if ndef then
local drop
if type(ndef.drop) == "string" then
drop = ndef.drop:sub((b or 8)+1)
end
local tiles = ndef.tiles
if #ndef.tiles > 1 and ndef.drawtype:find("glass") then
tiles = { ndef.tiles[1] }
end
stairsplus:register_all("moreblocks", name, nodename, {
description = ndef.description,
drop = drop,
groups = ndef.groups,
sounds = ndef.sounds,
tiles = tiles,
sunlight_propagates = true,
light_source = ndef.light_source
})
end
2014-03-09 10:38:18 +01:00
end