-- Node will be called stairs:stair_inner_<subname>
function stairs.register_stair_inner(subname, recipeitem, groups, images,
- description, sounds, worldaligntex)
+ description, sounds, worldaligntex, full_description)
-- Set backface culling and world-aligned textures
local stair_images = {}
for i, image in ipairs(images) do
end
local new_groups = table.copy(groups)
new_groups.stair = 1
+ if full_description then
+ description = full_description
+ else
+ description = "Inner " .. description
+ end
warn_if_exists("stairs:stair_inner_" .. subname)
minetest.register_node(":stairs:stair_inner_" .. subname, {
- description = S("Inner @1", description),
+ description = description,
drawtype = "nodebox",
tiles = stair_images,
paramtype = "light",
-- Node will be called stairs:stair_outer_<subname>
function stairs.register_stair_outer(subname, recipeitem, groups, images,
- description, sounds, worldaligntex)
+ description, sounds, worldaligntex, full_description)
-- Set backface culling and world-aligned textures
local stair_images = {}
for i, image in ipairs(images) do
end
local new_groups = table.copy(groups)
new_groups.stair = 1
+ if full_description then
+ description = full_description
+ else
+ description = "Outer " .. description
+ end
warn_if_exists("stairs:stair_outer_" .. subname)
minetest.register_node(":stairs:stair_outer_" .. subname, {
- description = S("Outer @1", description),
+ description = description,
drawtype = "nodebox",
tiles = stair_images,
paramtype = "light",
sounds, worldaligntex)
end
+-- Local function so we can apply translations
+local function my_register_stair_and_slab(subname, recipeitem, groups, images,
+ desc_stair, desc_slab, sounds, worldaligntex)
+ stairs.register_stair(subname, recipeitem, groups, images, S(desc_stair),
+ sounds, worldaligntex)
+ stairs.register_stair_inner(subname, recipeitem, groups, images, "",
+ sounds, worldaligntex, S("Inner " .. desc_stair))
+ stairs.register_stair_outer(subname, recipeitem, groups, images, "",
+ sounds, worldaligntex, S("Outer " .. desc_stair))
+ stairs.register_slab(subname, recipeitem, groups, images, S(desc_slab),
+ sounds, worldaligntex)
+end
+
-- Register default stairs and slabs
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"wood",
"default:wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_wood.png"},
- S("Wooden Stair"),
- S("Wooden Slab"),
+ "Wooden Stair",
+ "Wooden Slab",
default.node_sound_wood_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"junglewood",
"default:junglewood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_junglewood.png"},
- S("Jungle Wood Stair"),
- S("Jungle Wood Slab"),
+ "Jungle Wood Stair",
+ "Jungle Wood Slab",
default.node_sound_wood_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"pine_wood",
"default:pine_wood",
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
{"default_pine_wood.png"},
- S("Pine Wood Stair"),
- S("Pine Wood Slab"),
+ "Pine Wood Stair",
+ "Pine Wood Slab",
default.node_sound_wood_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"acacia_wood",
"default:acacia_wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_acacia_wood.png"},
- S("Acacia Wood Stair"),
- S("Acacia Wood Slab"),
+ "Acacia Wood Stair",
+ "Acacia Wood Slab",
default.node_sound_wood_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"aspen_wood",
"default:aspen_wood",
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
{"default_aspen_wood.png"},
- S("Aspen Wood Stair"),
- S("Aspen Wood Slab"),
+ "Aspen Wood Stair",
+ "Aspen Wood Slab",
default.node_sound_wood_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"stone",
"default:stone",
{cracky = 3},
{"default_stone.png"},
- S("Stone Stair"),
- S("Stone Slab"),
+ "Stone Stair",
+ "Stone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"cobble",
"default:cobble",
{cracky = 3},
{"default_cobble.png"},
- S("Cobblestone Stair"),
- S("Cobblestone Slab"),
+ "Cobblestone Stair",
+ "Cobblestone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"mossycobble",
"default:mossycobble",
{cracky = 3},
{"default_mossycobble.png"},
- S("Mossy Cobblestone Stair"),
- S("Mossy Cobblestone Slab"),
+ "Mossy Cobblestone Stair",
+ "Mossy Cobblestone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"stonebrick",
"default:stonebrick",
{cracky = 2},
{"default_stone_brick.png"},
- S("Stone Brick Stair"),
- S("Stone Brick Slab"),
+ "Stone Brick Stair",
+ "Stone Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"stone_block",
"default:stone_block",
{cracky = 2},
{"default_stone_block.png"},
- S("Stone Block Stair"),
- S("Stone Block Slab"),
+ "Stone Block Stair",
+ "Stone Block Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_stone",
"default:desert_stone",
{cracky = 3},
{"default_desert_stone.png"},
- S("Desert Stone Stair"),
- S("Desert Stone Slab"),
+ "Desert Stone Stair",
+ "Desert Stone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_cobble",
"default:desert_cobble",
{cracky = 3},
{"default_desert_cobble.png"},
- S("Desert Cobblestone Stair"),
- S("Desert Cobblestone Slab"),
+ "Desert Cobblestone Stair",
+ "Desert Cobblestone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_stonebrick",
"default:desert_stonebrick",
{cracky = 2},
{"default_desert_stone_brick.png"},
- S("Desert Stone Brick Stair"),
- S("Desert Stone Brick Slab"),
+ "Desert Stone Brick Stair",
+ "Desert Stone Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_stone_block",
"default:desert_stone_block",
{cracky = 2},
{"default_desert_stone_block.png"},
- S("Desert Stone Block Stair"),
- S("Desert Stone Block Slab"),
+ "Desert Stone Block Stair",
+ "Desert Stone Block Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"sandstone",
"default:sandstone",
{crumbly = 1, cracky = 3},
{"default_sandstone.png"},
- S("Sandstone Stair"),
- S("Sandstone Slab"),
+ "Sandstone Stair",
+ "Sandstone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"sandstonebrick",
"default:sandstonebrick",
{cracky = 2},
{"default_sandstone_brick.png"},
- S("Sandstone Brick Stair"),
- S("Sandstone Brick Slab"),
+ "Sandstone Brick Stair",
+ "Sandstone Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"sandstone_block",
"default:sandstone_block",
{cracky = 2},
{"default_sandstone_block.png"},
- S("Sandstone Block Stair"),
- S("Sandstone Block Slab"),
+ "Sandstone Block Stair",
+ "Sandstone Block Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_sandstone",
"default:desert_sandstone",
{crumbly = 1, cracky = 3},
{"default_desert_sandstone.png"},
- S("Desert Sandstone Stair"),
- S("Desert Sandstone Slab"),
+ "Desert Sandstone Stair",
+ "Desert Sandstone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_sandstone_brick",
"default:desert_sandstone_brick",
{cracky = 2},
{"default_desert_sandstone_brick.png"},
- S("Desert Sandstone Brick Stair"),
- S("Desert Sandstone Brick Slab"),
+ "Desert Sandstone Brick Stair",
+ "Desert Sandstone Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"desert_sandstone_block",
"default:desert_sandstone_block",
{cracky = 2},
{"default_desert_sandstone_block.png"},
- S("Desert Sandstone Block Stair"),
- S("Desert Sandstone Block Slab"),
+ "Desert Sandstone Block Stair",
+ "Desert Sandstone Block Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"silver_sandstone",
"default:silver_sandstone",
{crumbly = 1, cracky = 3},
{"default_silver_sandstone.png"},
- S("Silver Sandstone Stair"),
- S("Silver Sandstone Slab"),
+ "Silver Sandstone Stair",
+ "Silver Sandstone Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"silver_sandstone_brick",
"default:silver_sandstone_brick",
{cracky = 2},
{"default_silver_sandstone_brick.png"},
- S("Silver Sandstone Brick Stair"),
- S("Silver Sandstone Brick Slab"),
+ "Silver Sandstone Brick Stair",
+ "Silver Sandstone Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"silver_sandstone_block",
"default:silver_sandstone_block",
{cracky = 2},
{"default_silver_sandstone_block.png"},
- S("Silver Sandstone Block Stair"),
- S("Silver Sandstone Block Slab"),
+ "Silver Sandstone Block Stair",
+ "Silver Sandstone Block Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"obsidian",
"default:obsidian",
{cracky = 1, level = 2},
{"default_obsidian.png"},
- S("Obsidian Stair"),
- S("Obsidian Slab"),
+ "Obsidian Stair",
+ "Obsidian Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"obsidianbrick",
"default:obsidianbrick",
{cracky = 1, level = 2},
{"default_obsidian_brick.png"},
- S("Obsidian Brick Stair"),
- S("Obsidian Brick Slab"),
+ "Obsidian Brick Stair",
+ "Obsidian Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"obsidian_block",
"default:obsidian_block",
{cracky = 1, level = 2},
{"default_obsidian_block.png"},
- S("Obsidian Block Stair"),
- S("Obsidian Block Slab"),
+ "Obsidian Block Stair",
+ "Obsidian Block Slab",
default.node_sound_stone_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"brick",
"default:brick",
{cracky = 3},
{"default_brick.png"},
- S("Brick Stair"),
- S("Brick Slab"),
+ "Brick Stair",
+ "Brick Slab",
default.node_sound_stone_defaults(),
false
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"steelblock",
"default:steelblock",
{cracky = 1, level = 2},
{"default_steel_block.png"},
- S("Steel Block Stair"),
- S("Steel Block Slab"),
+ "Steel Block Stair",
+ "Steel Block Slab",
default.node_sound_metal_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"tinblock",
"default:tinblock",
{cracky = 1, level = 2},
{"default_tin_block.png"},
- S("Tin Block Stair"),
- S("Tin Block Slab"),
+ "Tin Block Stair",
+ "Tin Block Slab",
default.node_sound_metal_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"copperblock",
"default:copperblock",
{cracky = 1, level = 2},
{"default_copper_block.png"},
- S("Copper Block Stair"),
- S("Copper Block Slab"),
+ "Copper Block Stair",
+ "Copper Block Slab",
default.node_sound_metal_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"bronzeblock",
"default:bronzeblock",
{cracky = 1, level = 2},
{"default_bronze_block.png"},
- S("Bronze Block Stair"),
- S("Bronze Block Slab"),
+ "Bronze Block Stair",
+ "Bronze Block Slab",
default.node_sound_metal_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"goldblock",
"default:goldblock",
{cracky = 1},
{"default_gold_block.png"},
- S("Gold Block Stair"),
- S("Gold Block Slab"),
+ "Gold Block Stair",
+ "Gold Block Slab",
default.node_sound_metal_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"ice",
"default:ice",
{cracky = 3, cools_lava = 1, slippery = 3},
{"default_ice.png"},
- S("Ice Stair"),
- S("Ice Slab"),
+ "Ice Stair",
+ "Ice Slab",
default.node_sound_glass_defaults(),
true
)
-stairs.register_stair_and_slab(
+my_register_stair_and_slab(
"snowblock",
"default:snowblock",
{crumbly = 3, cools_lava = 1, snowy = 1},
{"default_snow.png"},
- S("Snow Block Stair"),
- S("Snow Block Slab"),
+ "Snow Block Stair",
+ "Snow Block Slab",
default.node_sound_snow_defaults(),
true
)
{"stairs_glass_stairside.png^[transformR270", "default_glass.png",
"stairs_glass_stairside.png^[transformFX", "default_glass.png",
"default_glass.png", "stairs_glass_stairside.png"},
- S("Glass Stair"),
+ "",
default.node_sound_glass_defaults(),
- false
+ false,
+ S("Inner Glass Stair")
)
stairs.register_stair_outer(
{"stairs_glass_stairside.png^[transformR90", "default_glass.png",
"stairs_glass_outer_stairside.png", "stairs_glass_stairside.png",
"stairs_glass_stairside.png^[transformR90","stairs_glass_outer_stairside.png"},
- S("Glass Stair"),
+ "",
default.node_sound_glass_defaults(),
- false
+ false,
+ S("Outer Glass Stair")
)
stairs.register_stair(
{"stairs_obsidian_glass_stairside.png^[transformR270", "default_obsidian_glass.png",
"stairs_obsidian_glass_stairside.png^[transformFX", "default_obsidian_glass.png",
"default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png"},
- S("Obsidian Glass Stair"),
+ "",
default.node_sound_glass_defaults(),
- false
+ false,
+ S("Inner Obsidian Glass Stair")
)
stairs.register_stair_outer(
{"stairs_obsidian_glass_stairside.png^[transformR90", "default_obsidian_glass.png",
"stairs_obsidian_glass_outer_stairside.png", "stairs_obsidian_glass_stairside.png",
"stairs_obsidian_glass_stairside.png^[transformR90","stairs_obsidian_glass_outer_stairside.png"},
- S("Obsidian Glass Stair"),
+ "",
default.node_sound_glass_defaults(),
- false
+ false,
+ S("Outer Obsidian Glass Stair")
)
+
+-- Dummy calls to S() to allow translation scripts to detect the strings.
+-- To update this add this code to my_register_stair_and_slab:
+-- for _,x in ipairs({"","Inner ","Outer "}) do print(("S(%q)"):format(x..desc_stair)) end
+-- print(("S(%q)"):format(desc_slab))
+
+--[[
+S("Wooden Stair")
+S("Inner Wooden Stair")
+S("Outer Wooden Stair")
+S("Wooden Slab")
+S("Jungle Wood Stair")
+S("Inner Jungle Wood Stair")
+S("Outer Jungle Wood Stair")
+S("Jungle Wood Slab")
+S("Pine Wood Stair")
+S("Inner Pine Wood Stair")
+S("Outer Pine Wood Stair")
+S("Pine Wood Slab")
+S("Acacia Wood Stair")
+S("Inner Acacia Wood Stair")
+S("Outer Acacia Wood Stair")
+S("Acacia Wood Slab")
+S("Aspen Wood Stair")
+S("Inner Aspen Wood Stair")
+S("Outer Aspen Wood Stair")
+S("Aspen Wood Slab")
+S("Stone Stair")
+S("Inner Stone Stair")
+S("Outer Stone Stair")
+S("Stone Slab")
+S("Cobblestone Stair")
+S("Inner Cobblestone Stair")
+S("Outer Cobblestone Stair")
+S("Cobblestone Slab")
+S("Mossy Cobblestone Stair")
+S("Inner Mossy Cobblestone Stair")
+S("Outer Mossy Cobblestone Stair")
+S("Mossy Cobblestone Slab")
+S("Stone Brick Stair")
+S("Inner Stone Brick Stair")
+S("Outer Stone Brick Stair")
+S("Stone Brick Slab")
+S("Stone Block Stair")
+S("Inner Stone Block Stair")
+S("Outer Stone Block Stair")
+S("Stone Block Slab")
+S("Desert Stone Stair")
+S("Inner Desert Stone Stair")
+S("Outer Desert Stone Stair")
+S("Desert Stone Slab")
+S("Desert Cobblestone Stair")
+S("Inner Desert Cobblestone Stair")
+S("Outer Desert Cobblestone Stair")
+S("Desert Cobblestone Slab")
+S("Desert Stone Brick Stair")
+S("Inner Desert Stone Brick Stair")
+S("Outer Desert Stone Brick Stair")
+S("Desert Stone Brick Slab")
+S("Desert Stone Block Stair")
+S("Inner Desert Stone Block Stair")
+S("Outer Desert Stone Block Stair")
+S("Desert Stone Block Slab")
+S("Sandstone Stair")
+S("Inner Sandstone Stair")
+S("Outer Sandstone Stair")
+S("Sandstone Slab")
+S("Sandstone Brick Stair")
+S("Inner Sandstone Brick Stair")
+S("Outer Sandstone Brick Stair")
+S("Sandstone Brick Slab")
+S("Sandstone Block Stair")
+S("Inner Sandstone Block Stair")
+S("Outer Sandstone Block Stair")
+S("Sandstone Block Slab")
+S("Desert Sandstone Stair")
+S("Inner Desert Sandstone Stair")
+S("Outer Desert Sandstone Stair")
+S("Desert Sandstone Slab")
+S("Desert Sandstone Brick Stair")
+S("Inner Desert Sandstone Brick Stair")
+S("Outer Desert Sandstone Brick Stair")
+S("Desert Sandstone Brick Slab")
+S("Desert Sandstone Block Stair")
+S("Inner Desert Sandstone Block Stair")
+S("Outer Desert Sandstone Block Stair")
+S("Desert Sandstone Block Slab")
+S("Silver Sandstone Stair")
+S("Inner Silver Sandstone Stair")
+S("Outer Silver Sandstone Stair")
+S("Silver Sandstone Slab")
+S("Silver Sandstone Brick Stair")
+S("Inner Silver Sandstone Brick Stair")
+S("Outer Silver Sandstone Brick Stair")
+S("Silver Sandstone Brick Slab")
+S("Silver Sandstone Block Stair")
+S("Inner Silver Sandstone Block Stair")
+S("Outer Silver Sandstone Block Stair")
+S("Silver Sandstone Block Slab")
+S("Obsidian Stair")
+S("Inner Obsidian Stair")
+S("Outer Obsidian Stair")
+S("Obsidian Slab")
+S("Obsidian Brick Stair")
+S("Inner Obsidian Brick Stair")
+S("Outer Obsidian Brick Stair")
+S("Obsidian Brick Slab")
+S("Obsidian Block Stair")
+S("Inner Obsidian Block Stair")
+S("Outer Obsidian Block Stair")
+S("Obsidian Block Slab")
+S("Brick Stair")
+S("Inner Brick Stair")
+S("Outer Brick Stair")
+S("Brick Slab")
+S("Steel Block Stair")
+S("Inner Steel Block Stair")
+S("Outer Steel Block Stair")
+S("Steel Block Slab")
+S("Tin Block Stair")
+S("Inner Tin Block Stair")
+S("Outer Tin Block Stair")
+S("Tin Block Slab")
+S("Copper Block Stair")
+S("Inner Copper Block Stair")
+S("Outer Copper Block Stair")
+S("Copper Block Slab")
+S("Bronze Block Stair")
+S("Inner Bronze Block Stair")
+S("Outer Bronze Block Stair")
+S("Bronze Block Slab")
+S("Gold Block Stair")
+S("Inner Gold Block Stair")
+S("Outer Gold Block Stair")
+S("Gold Block Slab")
+S("Ice Stair")
+S("Inner Ice Stair")
+S("Outer Ice Stair")
+S("Ice Slab")
+S("Snow Block Stair")
+S("Inner Snow Block Stair")
+S("Outer Snow Block Stair")
+S("Snow Block Slab")
+--]]