techage/items/moreblocks.lua

100 lines
4.0 KiB
Lua
Raw Normal View History

2021-05-18 22:41:55 +03:00
--[[
TechAge
=======
Copyright (C) 2020-2021 Joachim Stolberg
AGPL v3
See LICENSE.txt for more information
techage node registrations
2022-01-03 23:40:31 +03:00
2021-05-18 22:41:55 +03:00
]]--
local function register_alias(name)
2022-07-11 21:16:23 +03:00
--minetest.register_alias("stairs:slab_" ..name, "techage:slab_" ..name)
2021-05-18 22:41:55 +03:00
minetest.register_alias("stairs:slab_" ..name.. "_inverted", "techage:slab_" ..name.. "_inverted")
minetest.register_alias("stairs:slab_" ..name.. "_wall", "techage:slab_" ..name.. "_wall")
minetest.register_alias("stairs:slab_" ..name.. "_quarter", "techage:slab_" ..name.. "_quarter")
minetest.register_alias("stairs:slab_" ..name.. "_quarter_inverted", "techage:slab_" ..name.. "_quarter_inverted")
minetest.register_alias("stairs:slab_" ..name.. "_quarter_wall", "techage:slab_" ..name.. "_quarter_wall")
minetest.register_alias("stairs:slab_" ..name.. "_three_quarter", "techage:slab_" ..name.. "_three_quarter")
minetest.register_alias("stairs:slab_" ..name.. "_three_quarter_inverted", "techage:slab_" ..name.. "_three_quarter_inverted")
minetest.register_alias("stairs:slab_" ..name.. "_three_quarter_wall", "techage:slab_" ..name.. "_three_quarter_wall")
2022-07-11 21:16:23 +03:00
--minetest.register_alias("stairs:stair_" ..name, "techage:stair_" ..name)
2021-05-18 22:41:55 +03:00
minetest.register_alias("stairs:stair_" ..name.. "_inverted", "techage:stair_" ..name.. "_inverted")
minetest.register_alias("stairs:stair_" ..name.. "_wall", "techage:stair_" ..name.. "_wall")
minetest.register_alias("stairs:stair_" ..name.. "_wall_half", "techage:stair_" ..name.. "_wall_half")
minetest.register_alias("stairs:stair_" ..name.. "_wall_half_inverted", "techage:stair_" ..name.. "_wall_half_inverted")
minetest.register_alias("stairs:stair_" ..name.. "_half", "techage:stair_" ..name.. "_half")
minetest.register_alias("stairs:stair_" ..name.. "_half_inverted", "techage:stair_" ..name.. "_half_inverted")
minetest.register_alias("stairs:stair_" ..name.. "_right_half", "techage:stair_" ..name.. "_right_half")
minetest.register_alias("stairs:stair_" ..name.. "_right_half_inverted", "techage:stair_" ..name.. "_right_half_inverted")
minetest.register_alias("stairs:stair_" ..name.. "_wall_half", "techage:stair_" ..name.. "_wall_half")
minetest.register_alias("stairs:stair_" ..name.. "_wall_half_inverted", "techage:stair_" ..name.. "_wall_half_inverted")
minetest.register_alias("stairs:stair_" ..name.. "_inner", "techage:stair_" ..name.. "_inner")
minetest.register_alias("stairs:stair_" ..name.. "_inner_inverted", "techage:stair_" ..name.. "_inner_inverted")
minetest.register_alias("stairs:stair_" ..name.. "_outer", "techage:stair_" ..name.. "_outer")
minetest.register_alias("stairs:stair_" ..name.. "_outer_inverted", "techage:stair_" ..name.. "_outer_inverted")
end
local NodeNames = {
2021-06-04 17:30:22 +03:00
"techage:compressed_gravel",
2021-05-18 22:41:55 +03:00
"techage:red_stone",
"techage:red_stone_block",
"techage:red_stone_brick",
2022-01-03 23:40:31 +03:00
2021-05-18 22:41:55 +03:00
"techage:basalt_cobble",
"techage:basalt_stone",
"techage:basalt_stone_block",
"techage:basalt_stone_brick",
"techage:sieved_basalt_gravel",
2022-01-03 23:40:31 +03:00
2021-05-18 22:41:55 +03:00
"techage:basalt_glass",
"techage:basalt_glass2",
"techage:bauxite_cobble",
2023-04-11 11:44:21 +03:00
"techage:bauxite_stone",
2023-02-11 20:41:21 +03:00
"techage:cement_block",
2021-05-18 22:41:55 +03:00
}
if(minetest.get_modpath("moreblocks")) then
for _,name in ipairs(NodeNames) do
local ndef = minetest.registered_nodes[name]
if ndef then
ndef = table.copy(ndef)
2023-04-11 11:44:21 +03:00
if ndef.drop then -- this fixes https://github.com/fluxionary/minetest-moreblocks/issues/19
ndef.drop = nil
end
2021-05-18 22:41:55 +03:00
local subname = string.split(name, ":")[2]
ndef.sunlight_propagates = true
ndef.groups.not_in_creative_inventory = 1
stairsplus:register_all("techage", subname, name, ndef)
2023-03-13 16:11:08 +03:00
if techage.stair_aliases_enabled then
register_alias(subname)
end
2021-05-18 22:41:55 +03:00
end
2023-03-13 16:11:08 +03:00
end
2021-05-18 22:41:55 +03:00
else
for _,name in ipairs(NodeNames) do
local ndef = minetest.registered_nodes[name]
if ndef then
local subname = string.split(name, ":")[2]
stairs.register_stair_and_slab(
subname,
name,
ndef.groups,
ndef.tiles,
ndef.description.." Stair",
ndef.description.." Slab",
ndef.sound,
false
)
2023-03-13 16:11:08 +03:00
if techage.stair_aliases_enabled then
register_alias(subname)
end
2021-05-18 22:41:55 +03:00
end
end
end