drop stairs api support and fix use_texture_alpha for stairs

This commit is contained in:
unknown 2021-11-27 23:43:59 -05:00
parent 63ad77e242
commit 21ae9f8c17

View File

@ -1,77 +1,48 @@
local S = minetest.get_translator("building_blocks") local S = minetest.get_translator("building_blocks")
local stairs_groups_names = {"cracky","choppy","flammable","crumbly","snappy"}
local function building_blocks_stairs(nodename, def) local function building_blocks_stairs(nodename, def)
minetest.register_node(nodename, def) minetest.register_node(nodename, def)
if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs") then
local mod, name = nodename:match("(.*):(.*)")
minetest.register_alias(mod .. ":slab_" .. name, "stairs:slab_" .. name)
minetest.register_alias(mod .. ":stair_" .. name, "stairs:stair_" .. name)
local stairs_groups = {}
for _, groupname in ipairs(stairs_groups_names) do
stairs_groups[groupname] = def.groups[groupname]
end
if minetest.get_modpath("moreblocks") then if minetest.get_modpath("moreblocks") then
stairsplus:register_all( local mod, name = nodename:match("(.*):(.*)")
mod, stairsplus:register_all(mod, name, nodename, def)
name,
nodename, minetest.register_alias("stairs:slab_" .. name, mod .. ":slab_" .. name)
{ minetest.register_alias("stairs:stair_" .. name, mod .. ":stair_" .. name)
description = def.description, minetest.register_alias("stairs:stair_inner_" .. name, mod .. ":stair_" .. name .. "_inner")
tiles = def.tiles, minetest.register_alias("stairs:stair_outer_" .. name, mod .. ":stair_" .. name .. "_outer")
groups = stairs_groups,
sounds = def.sounds,
}
)
else
stairs.register_stair_and_slab(name,nodename,
stairs_groups,
def.tiles,
def.stair_desc,
def.slab_desc,
def.sounds
--FIXME: Missing descriptions for Inner and Outer stairs
-- See https://github.com/minetest/minetest_game/pull/2584
)
end
end end
end end
building_blocks_stairs("building_blocks:grate", { building_blocks_stairs("building_blocks:grate", {
drawtype = "glasslike", drawtype = "glasslike",
description = S("Grate"), description = S("Grate"),
stair_desc = S("Grate Stair"),
slab = S("Grate Slab"),
tiles = {"building_blocks_grate.png"}, tiles = {"building_blocks_grate.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
is_ground_content = true, is_ground_content = true,
use_texture_alpha = "clip",
groups = {cracky=1}, groups = {cracky=1},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
building_blocks_stairs("building_blocks:smoothglass", { building_blocks_stairs("building_blocks:smoothglass", {
drawtype = "glasslike", drawtype = "glasslike",
description = S("Streak Free Glass"), description = S("Streak Free Glass"),
stair_desc = S("Streak Free Glass Stair"),
slab_desc = S("Streak Free Glass Slab"),
tiles = {"building_blocks_sglass.png"}, tiles = {"building_blocks_sglass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
is_ground_content = true, is_ground_content = true,
use_texture_alpha = "clip",
groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3}, groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
building_blocks_stairs("building_blocks:woodglass", { building_blocks_stairs("building_blocks:woodglass", {
drawtype = "glasslike", drawtype = "glasslike",
description = S("Wood Framed Glass"), description = S("Wood Framed Glass"),
stair_desc = S("Wood Framed Glass Stair"),
slab_desc = S("Wood Framed Glass Slab"),
tiles = {"building_blocks_wglass.png"}, tiles = {"building_blocks_wglass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
is_ground_content = true, is_ground_content = true,
use_texture_alpha = "clip",
groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3}, groups = {snappy=3,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
@ -79,8 +50,6 @@ building_blocks_stairs("building_blocks:woodglass", {
building_blocks_stairs("building_blocks:Adobe", { building_blocks_stairs("building_blocks:Adobe", {
tiles = {"building_blocks_Adobe.png"}, tiles = {"building_blocks_Adobe.png"},
description = S("Adobe"), description = S("Adobe"),
stair_desc = S("Adobe Stair"),
slab_desc = S("Adobe Slab"),
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -88,8 +57,6 @@ building_blocks_stairs("building_blocks:Adobe", {
building_blocks_stairs("building_blocks:fakegrass", { building_blocks_stairs("building_blocks:fakegrass", {
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
description = S("Fake Grass"), description = S("Fake Grass"),
stair_desc = S("Fake Grass Stair"),
slab_desc = S("Fake Grass Slab"),
is_ground_content = true, is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
@ -100,8 +67,6 @@ building_blocks_stairs("building_blocks:hardwood", {
tiles = {"building_blocks_hardwood.png"}, tiles = {"building_blocks_hardwood.png"},
is_ground_content = true, is_ground_content = true,
description = S("Hardwood"), description = S("Hardwood"),
stair_desc = S("Hardwood Stair"),
slab_desc = S("Hardwood Slab"),
groups = {choppy=1,flammable=1}, groups = {choppy=1,flammable=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -109,15 +74,11 @@ building_blocks_stairs("building_blocks:Roofing", {
tiles = {"building_blocks_Roofing.png"}, tiles = {"building_blocks_Roofing.png"},
is_ground_content = true, is_ground_content = true,
description = S("Roof block"), description = S("Roof block"),
stair_desc = S("Roof block Stair"),
slab_desc = S("Roof block Slab"),
groups = {snappy=3}, groups = {snappy=3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
building_blocks_stairs("building_blocks:Tar", { building_blocks_stairs("building_blocks:Tar", {
description = S("Tar"), description = S("Tar"),
stair_desc = S("Tar Stair"),
slab_desc = S("Tar Slab"),
tiles = {"building_blocks_tar.png"}, tiles = {"building_blocks_tar.png"},
is_ground_content = true, is_ground_content = true,
groups = {crumbly=1, tar_block = 1}, groups = {crumbly=1, tar_block = 1},
@ -125,8 +86,6 @@ building_blocks_stairs("building_blocks:Tar", {
}) })
building_blocks_stairs("building_blocks:Marble", { building_blocks_stairs("building_blocks:Marble", {
description = S("Marble"), description = S("Marble"),
stair_desc = S("Marble Stair"),
slab_desc = S("Marble Slab"),
tiles = {"building_blocks_marble.png"}, tiles = {"building_blocks_marble.png"},
is_ground_content = true, is_ground_content = true,
groups = {cracky=3, marble = 1}, groups = {cracky=3, marble = 1},