2015-01-11 22:21:33 +01:00
|
|
|
--[[
|
2015-01-12 17:46:22 +01:00
|
|
|
More Blocks: registrations
|
2015-01-11 22:21:33 +01:00
|
|
|
|
2017-02-19 13:35:16 +01:00
|
|
|
Copyright (c) 2011-2017 Hugo Locurcio and contributors.
|
2015-01-11 22:21:33 +01:00
|
|
|
Licensed under the zlib license. See LICENSE.md for more information.
|
|
|
|
--]]
|
|
|
|
|
2017-12-19 23:42:45 +01:00
|
|
|
-- default registrations
|
2014-06-27 20:14:08 +02:00
|
|
|
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
2014-03-09 10:38:18 +01:00
|
|
|
"stone",
|
2017-02-23 17:08:22 +01:00
|
|
|
"stone_block",
|
2014-03-09 10:38:18 +01:00
|
|
|
"cobble",
|
|
|
|
"mossycobble",
|
|
|
|
"brick",
|
|
|
|
"sandstone",
|
|
|
|
"steelblock",
|
|
|
|
"goldblock",
|
|
|
|
"copperblock",
|
|
|
|
"bronzeblock",
|
|
|
|
"diamondblock",
|
2017-08-12 23:07:33 +02:00
|
|
|
"tinblock",
|
2014-03-09 10:38:18 +01:00
|
|
|
"desert_stone",
|
2017-02-23 17:08:22 +01:00
|
|
|
"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",
|
2015-08-24 19:37:20 +02:00
|
|
|
"pine_tree",
|
|
|
|
"pine_wood",
|
|
|
|
"acacia_tree",
|
|
|
|
"acacia_wood",
|
2016-06-10 19:47:18 +02:00
|
|
|
"aspen_tree",
|
|
|
|
"aspen_wood",
|
2014-03-09 10:38:18 +01:00
|
|
|
"obsidian",
|
2017-02-23 17:08:22 +01:00
|
|
|
"obsidian_block",
|
|
|
|
"obsidianbrick",
|
2014-03-09 10:38:18 +01:00
|
|
|
"obsidian_glass",
|
|
|
|
"stonebrick",
|
|
|
|
"desert_stonebrick",
|
|
|
|
"sandstonebrick",
|
2017-08-12 23:07:33 +02:00
|
|
|
"silver_sandstone",
|
|
|
|
"silver_sandstone_brick",
|
|
|
|
"silver_sandstone_block",
|
|
|
|
"desert_sandstone",
|
|
|
|
"desert_sandstone_brick",
|
|
|
|
"desert_sandstone_block",
|
2017-02-23 17:08:22 +01:00
|
|
|
"sandstone_block",
|
|
|
|
"coral_skeleton",
|
2014-03-09 10:38:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, name in pairs(default_nodes) do
|
2017-12-19 23:42:45 +01:00
|
|
|
local mod = "default"
|
|
|
|
local nodename = mod .. ":" .. name
|
|
|
|
local ndef = table.copy(minetest.registered_nodes[nodename])
|
|
|
|
ndef.sunlight_propagates = true
|
|
|
|
|
|
|
|
-- Stone and desert_stone drop cobble and desert_cobble respectively.
|
|
|
|
if type(ndef.drop) == "string" then
|
|
|
|
ndef.drop = ndef.drop:gsub(".+:", "")
|
2017-02-23 17:08:22 +01:00
|
|
|
end
|
2016-02-19 22:31:12 +01:00
|
|
|
|
2017-12-19 23:42:45 +01:00
|
|
|
-- Use the primary tile for all sides of cut glasslike nodes.
|
|
|
|
if #ndef.tiles > 1 and ndef.drawtype and ndef.drawtype:find("glass") then
|
|
|
|
ndef.tiles = {ndef.tiles[1]}
|
|
|
|
end
|
2016-02-19 22:31:12 +01:00
|
|
|
|
2017-12-19 23:42:45 +01:00
|
|
|
stairsplus:register_all("moreblocks", name, nodename, ndef)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- farming registrations
|
|
|
|
if minetest.get_modpath("farming") then
|
|
|
|
local farming_nodes = {"straw"}
|
|
|
|
for _, name in pairs(farming_nodes) do
|
|
|
|
local mod = "farming"
|
|
|
|
local nodename = mod .. ":" .. name
|
|
|
|
local ndef = table.copy(minetest.registered_nodes[nodename])
|
|
|
|
ndef.sunlight_propagates = true
|
|
|
|
stairsplus:register_all("moreblocks", name, nodename, ndef)
|
2014-05-10 20:35:40 +02:00
|
|
|
end
|
2014-03-09 10:38:18 +01:00
|
|
|
end
|
2017-03-15 06:13:16 +01:00
|
|
|
|
|
|
|
-- wool registrations
|
|
|
|
if minetest.get_modpath("wool") then
|
2017-12-19 23:42:45 +01:00
|
|
|
local dyes = {"white", "grey", "black", "red", "yellow", "green", "cyan",
|
|
|
|
"blue", "magenta", "orange", "violet", "brown", "pink",
|
|
|
|
"dark_grey", "dark_green"}
|
|
|
|
for _, name in pairs(dyes) do
|
|
|
|
local mod = "wool"
|
|
|
|
local nodename = mod .. ":" .. name
|
|
|
|
local ndef = table.copy(minetest.registered_nodes[nodename])
|
|
|
|
ndef.sunlight_propagates = true
|
2017-03-15 06:13:16 +01:00
|
|
|
|
2017-12-19 23:42:45 +01:00
|
|
|
-- Prevent dye+cut wool recipy from creating a full wool block.
|
|
|
|
ndef.groups.wool = nil
|
2017-03-15 06:13:16 +01:00
|
|
|
|
2017-12-19 23:42:45 +01:00
|
|
|
stairsplus:register_all(mod, name, nodename, ndef)
|
2017-03-15 06:13:16 +01:00
|
|
|
end
|
|
|
|
end
|