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
|
|
|
|
2020-01-01 04:09:24 +01:00
|
|
|
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
2015-01-11 22:21:33 +01:00
|
|
|
Licensed under the zlib license. See LICENSE.md for more information.
|
|
|
|
--]]
|
2021-11-14 02:14:19 +01:00
|
|
|
local S = moreblocks.S
|
2017-12-19 23:42:45 +01:00
|
|
|
-- default registrations
|
2021-08-26 20:46:07 +02:00
|
|
|
if minetest.get_modpath("default") then
|
|
|
|
local default_nodes = { -- Default stairs/slabs/panels/microblocks:
|
|
|
|
"stone",
|
|
|
|
"stone_block",
|
|
|
|
"cobble",
|
|
|
|
"mossycobble",
|
|
|
|
"brick",
|
|
|
|
"sandstone",
|
|
|
|
"steelblock",
|
|
|
|
"goldblock",
|
|
|
|
"copperblock",
|
|
|
|
"bronzeblock",
|
|
|
|
"diamondblock",
|
|
|
|
"tinblock",
|
|
|
|
"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",
|
|
|
|
"silver_sandstone",
|
|
|
|
"silver_sandstone_brick",
|
|
|
|
"silver_sandstone_block",
|
|
|
|
"desert_sandstone",
|
|
|
|
"desert_sandstone_brick",
|
|
|
|
"desert_sandstone_block",
|
|
|
|
"sandstone_block",
|
|
|
|
"coral_skeleton",
|
|
|
|
"ice",
|
|
|
|
}
|
2014-03-09 10:38:18 +01:00
|
|
|
|
2021-08-26 20:46:07 +02:00
|
|
|
for _, name in pairs(default_nodes) do
|
|
|
|
local mod = "default"
|
|
|
|
local nodename = mod .. ":" .. name
|
|
|
|
local ndef = table.copy(minetest.registered_nodes[nodename])
|
|
|
|
ndef.sunlight_propagates = true
|
2017-12-19 23:42:45 +01:00
|
|
|
|
2021-08-26 20:46:07 +02:00
|
|
|
-- Stone and desert_stone drop cobble and desert_cobble respectively.
|
|
|
|
if type(ndef.drop) == "string" then
|
|
|
|
ndef.drop = ndef.drop:gsub(".+:", "")
|
|
|
|
end
|
2016-02-19 22:31:12 +01:00
|
|
|
|
2021-08-26 20:46:07 +02:00
|
|
|
-- Use the primary tile for all sides of cut glasslike nodes and disregard paramtype2.
|
|
|
|
if #ndef.tiles > 1 and ndef.drawtype and ndef.drawtype:find("glass") then
|
|
|
|
ndef.tiles = {ndef.tiles[1]}
|
|
|
|
ndef.paramtype2 = nil
|
|
|
|
end
|
2016-02-19 22:31:12 +01:00
|
|
|
|
2021-08-26 20:46:07 +02:00
|
|
|
mod = "moreblocks"
|
|
|
|
stairsplus:register_all(mod, name, nodename, ndef)
|
|
|
|
minetest.register_alias_force("stairs:stair_" .. name, mod .. ":stair_" .. name)
|
|
|
|
minetest.register_alias_force("stairs:stair_outer_" .. name, mod .. ":stair_" .. name .. "_outer")
|
|
|
|
minetest.register_alias_force("stairs:stair_inner_" .. name, mod .. ":stair_" .. name .. "_inner")
|
|
|
|
minetest.register_alias_force("stairs:slab_" .. name, mod .. ":slab_" .. name)
|
|
|
|
end
|
2017-12-19 23:42:45 +01:00
|
|
|
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
|
2016-04-23 03:47:04 +02:00
|
|
|
|
|
|
|
mod = "moreblocks"
|
|
|
|
stairsplus:register_all(mod, name, nodename, ndef)
|
|
|
|
minetest.register_alias_force("stairs:stair_" .. name, mod .. ":stair_" .. name)
|
2018-07-19 19:24:30 +02:00
|
|
|
minetest.register_alias_force("stairs:stair_outer_" .. name, mod .. ":stair_" .. name .. "_outer")
|
|
|
|
minetest.register_alias_force("stairs:stair_inner_" .. name, mod .. ":stair_" .. name .. "_inner")
|
2016-04-23 03:47:04 +02:00
|
|
|
minetest.register_alias_force("stairs:slab_" .. name, mod .. ":slab_" .. name)
|
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
|
|
|
stairsplus:register_all(mod, name, nodename, ndef)
|
2017-03-15 06:13:16 +01:00
|
|
|
end
|
|
|
|
end
|
2017-12-30 16:30:40 +01:00
|
|
|
|
2018-11-24 17:27:16 +01:00
|
|
|
-- basic_materials, keeping the original other-mod-oriented names
|
2018-11-23 17:25:04 +01:00
|
|
|
-- for backwards compatibility
|
|
|
|
|
|
|
|
if minetest.get_modpath("basic_materials") then
|
|
|
|
stairsplus:register_all("technic","concrete","basic_materials:concrete_block",{
|
2021-11-14 02:14:19 +01:00
|
|
|
description = S("Concrete"),
|
2018-11-23 17:25:04 +01:00
|
|
|
tiles = {"basic_materials_concrete_block.png",},
|
|
|
|
groups = {cracky=1, level=2, concrete=1},
|
2021-08-26 20:46:07 +02:00
|
|
|
sounds = moreblocks.node_sound_stone_defaults(),
|
2018-11-23 17:25:04 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_alias("prefab:concrete_stair","technic:stair_concrete")
|
|
|
|
minetest.register_alias("prefab:concrete_slab","technic:slab_concrete")
|
2018-11-24 16:44:35 +01:00
|
|
|
|
|
|
|
stairsplus:register_all("gloopblocks", "cement", "basic_materials:cement_block", {
|
2021-11-14 02:14:19 +01:00
|
|
|
description = S("Cement"),
|
2018-11-24 16:44:35 +01:00
|
|
|
tiles = {"basic_materials_cement_block.png"},
|
|
|
|
groups = {cracky=2, not_in_creative_inventory=1},
|
2021-08-26 20:46:07 +02:00
|
|
|
sounds = moreblocks.node_sound_stone_defaults(),
|
2018-11-24 16:44:35 +01:00
|
|
|
sunlight_propagates = true,
|
|
|
|
})
|
|
|
|
|
2018-11-24 17:27:16 +01:00
|
|
|
stairsplus:register_all("technic", "brass_block", "basic_materials:brass_block", {
|
2021-11-14 02:14:19 +01:00
|
|
|
description= S("Brass Block"),
|
2018-11-24 17:27:16 +01:00
|
|
|
groups={cracky=1, not_in_creative_inventory=1},
|
|
|
|
tiles={"basic_materials_brass_block.png"},
|
|
|
|
})
|
|
|
|
|
2018-11-23 17:25:04 +01:00
|
|
|
end
|
|
|
|
|
2017-12-30 16:30:40 +01:00
|
|
|
-- Alias cuts of split_stone_tile_alt which was renamed checker_stone_tile.
|
|
|
|
stairsplus:register_alias_all("moreblocks", "split_stone_tile_alt", "moreblocks", "checker_stone_tile")
|
|
|
|
|
|
|
|
-- The following LBM is necessary because the name stair_split_stone_tile_alt
|
|
|
|
-- conflicts with another node and so the alias for that specific node gets
|
|
|
|
-- ignored.
|
|
|
|
minetest.register_lbm({
|
|
|
|
name = "moreblocks:fix_split_stone_tile_alt_name_collision",
|
|
|
|
nodenames = {"moreblocks:stair_split_stone_tile_alt"},
|
|
|
|
action = function(pos, node)
|
|
|
|
minetest.set_node(pos, {
|
|
|
|
name = "moreblocks:stair_checker_stone_tile",
|
|
|
|
param2 = minetest.get_node(pos).param2
|
|
|
|
|
|
|
|
})
|
|
|
|
minetest.log('action', "LBM replaced " .. node.name ..
|
2021-11-14 02:14:19 +01:00
|
|
|
" at " .. minetest.pos_to_string(pos))
|
2017-12-30 16:30:40 +01:00
|
|
|
end,
|
|
|
|
})
|