mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2024-11-16 15:30:17 +01:00
f4b68fbfd7
* add some 0.4.15 default nodes to table saw including farming:straw * fix hard-coded drop
77 lines
1.5 KiB
Lua
77 lines
1.5 KiB
Lua
--[[
|
|
More Blocks: registrations
|
|
|
|
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:
|
|
"stone",
|
|
"stone_block",
|
|
"cobble",
|
|
"mossycobble",
|
|
"brick",
|
|
"sandstone",
|
|
"steelblock",
|
|
"goldblock",
|
|
"copperblock",
|
|
"bronzeblock",
|
|
"diamondblock",
|
|
"desert_stone",
|
|
"desert_stone_block",
|
|
"desert_cobble",
|
|
"meselamp",
|
|
"glass",
|
|
"tree",
|
|
"wood",
|
|
"jungletree",
|
|
"junglewood",
|
|
"pine_tree",
|
|
"pine_wood",
|
|
"acacia_tree",
|
|
"acacia_wood",
|
|
"aspen_tree",
|
|
"aspen_wood",
|
|
"obsidian",
|
|
"obsidian_block",
|
|
"obsidianbrick",
|
|
"obsidian_glass",
|
|
"stonebrick",
|
|
"desert_stonebrick",
|
|
"sandstonebrick",
|
|
"sandstone_block",
|
|
"coral_skeleton",
|
|
"farming:straw"
|
|
}
|
|
|
|
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
|
|
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
|
|
end
|