Refactor lzr_stairs
This commit is contained in:
parent
2150bd6ec8
commit
15a1ebd481
48
mods/lzr_stairs/aliases.lua
Normal file
48
mods/lzr_stairs/aliases.lua
Normal file
@ -0,0 +1,48 @@
|
||||
-- Node aliases for all slab and stair nodes from v1.4.0.
|
||||
-- In v1.4.0, the mod was still called 'stairs' and only
|
||||
-- 1 laser color was supported.
|
||||
minetest.register_alias("stairs:stair_wood", "lzr_stairs:stair_wood")
|
||||
minetest.register_alias("stairs:stair_inner_wood", "lzr_stairs:stair_inner_wood")
|
||||
minetest.register_alias("stairs:stair_outer_wood", "lzr_stairs:stair_outer_wood")
|
||||
minetest.register_alias("stairs:slab_wood", "lzr_stairs:slab_wood_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_wood", "lzr_stairs:slab_wood_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_wood_mossy", "lzr_stairs:stair_wood_mossy")
|
||||
minetest.register_alias("stairs:stair_inner_wood_mossy", "lzr_stairs:stair_inner_wood_mossy")
|
||||
minetest.register_alias("stairs:stair_outer_wood_mossy", "lzr_stairs:stair_outer_wood_mossy")
|
||||
minetest.register_alias("stairs:slab_wood_mossy", "lzr_stairs:slab_wood_mossy_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_wood_mossy", "lzr_stairs:slab_wood_mossy_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_palm_wood", "lzr_stairs:stair_palm_wood")
|
||||
minetest.register_alias("stairs:stair_inner_palm_wood", "lzr_stairs:stair_inner_palm_wood")
|
||||
minetest.register_alias("stairs:stair_outer_palm_wood", "lzr_stairs:stair_outer_palm_wood")
|
||||
minetest.register_alias("stairs:slab_palm_wood", "lzr_stairs:slab_palm_wood_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_palm_wood", "lzr_stairs:slab_palm_wood_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_coconut_wood", "lzr_stairs:stair_coconut_wood")
|
||||
minetest.register_alias("stairs:stair_inner_coconut_wood", "lzr_stairs:stair_inner_coconut_wood")
|
||||
minetest.register_alias("stairs:stair_outer_coconut_wood", "lzr_stairs:stair_outer_coconut_wood")
|
||||
minetest.register_alias("stairs:slab_coconut_wood", "lzr_stairs:slab_coconut_wood_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_coconut_wood", "lzr_stairs:slab_coconut_wood_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_stone", "lzr_stairs:stair_stone")
|
||||
minetest.register_alias("stairs:stair_inner_stone", "lzr_stairs:stair_inner_stone")
|
||||
minetest.register_alias("stairs:stair_outer_stone", "lzr_stairs:stair_outer_stone")
|
||||
minetest.register_alias("stairs:slab_stone", "lzr_stairs:slab_stone_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_stone", "lzr_stairs:slab_stone_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_ocean_stone", "lzr_stairs:stair_ocean_stone")
|
||||
minetest.register_alias("stairs:stair_inner_ocean_stone", "lzr_stairs:stair_inner_ocean_stone")
|
||||
minetest.register_alias("stairs:stair_outer_ocean_stone", "lzr_stairs:stair_outer_ocean_stone")
|
||||
minetest.register_alias("stairs:slab_ocean_stone", "lzr_stairs:slab_ocean_stone_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_ocean_stone", "lzr_stairs:slab_ocean_stone_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_ocean_cobble", "lzr_stairs:stair_ocean_cobble")
|
||||
minetest.register_alias("stairs:stair_inner_ocean_cobble", "lzr_stairs:stair_inner_ocean_cobble")
|
||||
minetest.register_alias("stairs:stair_outer_ocean_cobble", "lzr_stairs:stair_outer_ocean_cobble")
|
||||
minetest.register_alias("stairs:slab_ocean_cobble", "lzr_stairs:slab_ocean_cobble_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_ocean_cobble", "lzr_stairs:slab_ocean_cobble_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_thatch", "lzr_stairs:stair_thatch")
|
||||
minetest.register_alias("stairs:stair_inner_thatch", "lzr_stairs:stair_inner_thatch")
|
||||
minetest.register_alias("stairs:stair_outer_thatch", "lzr_stairs:stair_outer_thatch")
|
||||
minetest.register_alias("stairs:slab_thatch", "lzr_stairs:slab_thatch_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_thatch", "lzr_stairs:slab_thatch_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_thatch_wet", "lzr_stairs:stair_thatch_wet")
|
||||
minetest.register_alias("stairs:stair_inner_thatch_wet", "lzr_stairs:stair_inner_thatch_wet")
|
||||
minetest.register_alias("stairs:stair_outer_thatch_wet", "lzr_stairs:stair_outer_thatch_wet")
|
||||
minetest.register_alias("stairs:slab_thatch_wet", "lzr_stairs:slab_thatch_wet_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_thatch_wet", "lzr_stairs:slab_thatch_wet_fixed_on_1")
|
@ -2,19 +2,8 @@
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
-- Global namespace for functions
|
||||
|
||||
lzr_stairs = {}
|
||||
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("lzr_stairs")
|
||||
-- Same as S, but will be ignored by translation file update scripts
|
||||
local T = S
|
||||
|
||||
-- If set to true, will print a list of translatable strings
|
||||
-- for the registered nodes to the console so it can
|
||||
-- be copied into this source file.
|
||||
local GENERATE_TRANSLATABLE_STRING_LIST = false
|
||||
|
||||
local function rotate_and_place(itemstack, placer, pointed_thing)
|
||||
local p0 = pointed_thing.under
|
||||
local p1 = pointed_thing.above
|
||||
@ -325,387 +314,9 @@ function lzr_stairs.register_stair_and_slab(subname, recipeitem, groups, images,
|
||||
sounds, worldaligntex)
|
||||
end
|
||||
|
||||
local function my_register_slab(subname, recipeitem, groups, images,
|
||||
desc_slab, sounds, worldaligntex)
|
||||
lzr_stairs.register_slab(subname, recipeitem, groups, images, desc_slab,
|
||||
sounds, worldaligntex)
|
||||
end
|
||||
|
||||
-- Local function so we can apply translations
|
||||
local function my_register_stair(subname, recipeitem, groups, images,
|
||||
desc_stair, sounds, worldaligntex)
|
||||
lzr_stairs.register_stair(subname, recipeitem, groups, images, S(desc_stair),
|
||||
sounds, worldaligntex)
|
||||
lzr_stairs.register_stair_inner(subname, recipeitem, groups, images, "",
|
||||
sounds, worldaligntex, T("Inner " .. desc_stair))
|
||||
lzr_stairs.register_stair_outer(subname, recipeitem, groups, images, "",
|
||||
sounds, worldaligntex, T("Outer " .. desc_stair))
|
||||
end
|
||||
local function my_register_stair_and_slab(subname, recipeitem, groups, images,
|
||||
desc_stair, desc_slab, sounds, worldaligntex)
|
||||
my_register_stair(subname, recipeitem, groups, images,
|
||||
desc_stair, sounds, worldaligntex)
|
||||
lzr_stairs.register_slab(subname, recipeitem, groups, images, S(desc_slab),
|
||||
sounds, worldaligntex)
|
||||
|
||||
if GENERATE_TRANSLATABLE_STRING_LIST then
|
||||
for _,x in ipairs({"","Inner ","Outer "}) do
|
||||
print(("S(%q)"):format(x..desc_stair))
|
||||
end
|
||||
print(("S(%q)"):format(desc_slab))
|
||||
end
|
||||
end
|
||||
|
||||
-- Register default stairs and slabs
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"wood",
|
||||
"lzr_core:wood",
|
||||
{breakable=1},
|
||||
{"default_wood.png"},
|
||||
"Wooden Stair",
|
||||
"Wooden Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"wood_mossy",
|
||||
"lzr_core:wood_mossy",
|
||||
{breakable=1},
|
||||
{"lzr_core_wood_mossy.png"},
|
||||
"Mossy Wooden Stair",
|
||||
"Mossy Wooden Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"palm_wood",
|
||||
"lzr_core:palm_wood",
|
||||
{breakable=1},
|
||||
{"lzr_core_palm_wood.png"},
|
||||
"Palm Wood Stair",
|
||||
"Palm Wood Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"coconut_wood",
|
||||
"lzr_core:coconut_wood",
|
||||
{breakable=1},
|
||||
{"lzr_core_coconut_wood.png"},
|
||||
"Coconut Wood Stair",
|
||||
"Coconut Wood Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
|
||||
lzr_stairs.register_slab(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"default_stone_block.png", "default_stone_block.png", "lzr_stairs_stone_block_slab.png"},
|
||||
"Stone Block Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
lzr_stairs.register_stair(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_slab.png^[transformFY","default_stone_block.png","lzr_stairs_stone_block_stair.png^[transformFX","lzr_stairs_stone_block_stair.png","default_stone_block.png","lzr_stairs_stone_block_slab.png"},
|
||||
"Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false
|
||||
)
|
||||
lzr_stairs.register_stair_inner(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_stair_inner_top.png","default_stone_block.png","lzr_stairs_stone_block_stair.png^[transformFX","default_stone_block.png","default_stone_block.png","lzr_stairs_stone_block_stair.png"},
|
||||
"Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Inner Stone Block Stair"
|
||||
)
|
||||
lzr_stairs.register_stair_outer(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_stair_outer_top.png","default_stone_block.png","lzr_stairs_stone_block_stair_outer_right.png","lzr_stairs_stone_block_stair.png","lzr_stairs_stone_block_stair.png^[transformFX","lzr_stairs_stone_block_stair_outer_left.png"},
|
||||
"Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Outer Stone Block Stair"
|
||||
)
|
||||
|
||||
lzr_stairs.register_slab(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"default_stone_block_mossy.png", "default_stone_block_mossy.png", "lzr_stairs_stone_block_mossy_slab.png"},
|
||||
"Mossy Stone Block Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
lzr_stairs.register_stair(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_mossy_slab.png^[transformFY","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair.png^[transformFX","lzr_stairs_stone_block_mossy_stair.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_slab.png"},
|
||||
"Mossy Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false
|
||||
)
|
||||
lzr_stairs.register_stair_inner(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_mossy_stair_inner_top.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair.png^[transformFX","default_stone_block_mossy.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair.png"},
|
||||
"Mossy Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Inner Mossy Stone Block Stair"
|
||||
)
|
||||
lzr_stairs.register_stair_outer(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_mossy_stair_outer_top.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair_outer_right.png","lzr_stairs_stone_block_mossy_stair.png","lzr_stairs_stone_block_mossy_stair.png^[transformFX","lzr_stairs_stone_block_mossy_stair_outer_left.png"},
|
||||
"Mossy Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Outer Mossy Stone Block Stair"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"stone",
|
||||
"lzr_core:stone",
|
||||
{breakable=1},
|
||||
{"default_stone.png"},
|
||||
"Stone Stair",
|
||||
"Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"cave_stone",
|
||||
"lzr_core:cave_stone",
|
||||
{breakable=1},
|
||||
{"lzr_core_cave_stone.png"},
|
||||
"Cave Stone Stair",
|
||||
"Cave Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"island_stone",
|
||||
"lzr_core:island_stone",
|
||||
{breakable=1},
|
||||
{"lzr_core_island_stone.png"},
|
||||
"Island Stone Stair",
|
||||
"Island Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"ocean_stone",
|
||||
"lzr_decor:ocean_stone",
|
||||
{breakable=1},
|
||||
{"xocean_stone.png"},
|
||||
"Ocean Stone Stair",
|
||||
"Ocean Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"ocean_cobble",
|
||||
"lzr_decor:ocean_cobble",
|
||||
{breakable=1},
|
||||
{"xocean_cobble.png"},
|
||||
"Ocean Cobblestone Stair",
|
||||
"Ocean Cobblestone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"thatch",
|
||||
"lzr_decor:thatch",
|
||||
{breakable=1},
|
||||
{"dryplants_thatch.png"},
|
||||
"Thatch Stair",
|
||||
"Thatch Slab",
|
||||
lzr_sounds.node_sound_leaves_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"thatch_wet",
|
||||
"lzr_decor:thatch_wet",
|
||||
{breakable=1},
|
||||
{"dryplants_thatch_wet.png"},
|
||||
"Wet Thatch Stair",
|
||||
"Wet Thatch Slab",
|
||||
lzr_sounds.node_sound_leaves_defaults(),
|
||||
true
|
||||
)
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"dirt",
|
||||
"lzr_core:dirt",
|
||||
{breakable=1},
|
||||
{"default_dirt.png"},
|
||||
"Dirt Stair",
|
||||
"Dirt Slab",
|
||||
lzr_sounds.node_sound_dirt_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"seabed",
|
||||
"lzr_core:seabed",
|
||||
{breakable=1},
|
||||
{"lzr_core_seabed.png"},
|
||||
"Seabed Stair",
|
||||
"Seabed Slab",
|
||||
lzr_sounds.node_sound_dirt_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"sand",
|
||||
"lzr_core:sand",
|
||||
{breakable=1},
|
||||
{"default_sand.png"},
|
||||
"Sand Stair",
|
||||
"Sand Slab",
|
||||
lzr_sounds.node_sound_sand_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"sandstone",
|
||||
"lzr_core:sandstone",
|
||||
{breakable=1},
|
||||
{"default_sandstone.png"},
|
||||
"Sandstone Stair",
|
||||
"Sandstone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
|
||||
-- Dummy calls to S() to allow translation scripts to detect the strings.
|
||||
-- MUST be updated before release when new nodes have arrived.
|
||||
-- To update this, set GENERATE_TRANSLATABLE_STRING_LIST to true
|
||||
-- and paste the console output here:
|
||||
--[[
|
||||
S("Wooden Stair")
|
||||
S("Inner Wooden Stair")
|
||||
S("Outer Wooden Stair")
|
||||
S("Wooden Slab")
|
||||
S("Mossy Wooden Stair")
|
||||
S("Inner Mossy Wooden Stair")
|
||||
S("Outer Mossy Wooden Stair")
|
||||
S("Mossy Wooden Slab")
|
||||
S("Palm Wood Stair")
|
||||
S("Inner Palm Wood Stair")
|
||||
S("Outer Palm Wood Stair")
|
||||
S("Palm Wood Slab")
|
||||
S("Coconut Wood Stair")
|
||||
S("Inner Coconut Wood Stair")
|
||||
S("Outer Coconut Wood Stair")
|
||||
S("Coconut Wood Slab")
|
||||
S("Stone Stair")
|
||||
S("Inner Stone Stair")
|
||||
S("Outer Stone Stair")
|
||||
S("Stone Slab")
|
||||
S("Cave Stone Stair")
|
||||
S("Inner Cave Stone Stair")
|
||||
S("Outer Cave Stone Stair")
|
||||
S("Cave Stone Slab")
|
||||
S("Island Stone Stair")
|
||||
S("Inner Island Stone Stair")
|
||||
S("Outer Island Stone Stair")
|
||||
S("Island Stone Slab")
|
||||
S("Ocean Stone Stair")
|
||||
S("Inner Ocean Stone Stair")
|
||||
S("Outer Ocean Stone Stair")
|
||||
S("Ocean Stone Slab")
|
||||
S("Ocean Cobblestone Stair")
|
||||
S("Inner Ocean Cobblestone Stair")
|
||||
S("Outer Ocean Cobblestone Stair")
|
||||
S("Ocean Cobblestone Slab")
|
||||
S("Thatch Stair")
|
||||
S("Inner Thatch Stair")
|
||||
S("Outer Thatch Stair")
|
||||
S("Thatch Slab")
|
||||
S("Wet Thatch Stair")
|
||||
S("Inner Wet Thatch Stair")
|
||||
S("Outer Wet Thatch Stair")
|
||||
S("Wet Thatch Slab")
|
||||
S("Dirt Stair")
|
||||
S("Inner Dirt Stair")
|
||||
S("Outer Dirt Stair")
|
||||
S("Dirt Slab")
|
||||
S("Seabed Stair")
|
||||
S("Inner Seabed Stair")
|
||||
S("Outer Seabed Stair")
|
||||
S("Seabed Slab")
|
||||
S("Sand Stair")
|
||||
S("Inner Sand Stair")
|
||||
S("Outer Sand Stair")
|
||||
S("Sand Slab")
|
||||
S("Sandstone Stair")
|
||||
S("Inner Sandstone Stair")
|
||||
S("Outer Sandstone Stair")
|
||||
S("Sandstone Slab")
|
||||
]]
|
||||
|
||||
|
||||
|
||||
-- Node aliases for all slab and stair nodes from v1.4.0.
|
||||
-- In v1.4.0, the mod was still called 'stairs' and only
|
||||
-- 1 laser color was supported.
|
||||
minetest.register_alias("stairs:stair_wood", "lzr_stairs:stair_wood")
|
||||
minetest.register_alias("stairs:stair_inner_wood", "lzr_stairs:stair_inner_wood")
|
||||
minetest.register_alias("stairs:stair_outer_wood", "lzr_stairs:stair_outer_wood")
|
||||
minetest.register_alias("stairs:slab_wood", "lzr_stairs:slab_wood_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_wood", "lzr_stairs:slab_wood_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_wood_mossy", "lzr_stairs:stair_wood_mossy")
|
||||
minetest.register_alias("stairs:stair_inner_wood_mossy", "lzr_stairs:stair_inner_wood_mossy")
|
||||
minetest.register_alias("stairs:stair_outer_wood_mossy", "lzr_stairs:stair_outer_wood_mossy")
|
||||
minetest.register_alias("stairs:slab_wood_mossy", "lzr_stairs:slab_wood_mossy_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_wood_mossy", "lzr_stairs:slab_wood_mossy_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_palm_wood", "lzr_stairs:stair_palm_wood")
|
||||
minetest.register_alias("stairs:stair_inner_palm_wood", "lzr_stairs:stair_inner_palm_wood")
|
||||
minetest.register_alias("stairs:stair_outer_palm_wood", "lzr_stairs:stair_outer_palm_wood")
|
||||
minetest.register_alias("stairs:slab_palm_wood", "lzr_stairs:slab_palm_wood_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_palm_wood", "lzr_stairs:slab_palm_wood_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_coconut_wood", "lzr_stairs:stair_coconut_wood")
|
||||
minetest.register_alias("stairs:stair_inner_coconut_wood", "lzr_stairs:stair_inner_coconut_wood")
|
||||
minetest.register_alias("stairs:stair_outer_coconut_wood", "lzr_stairs:stair_outer_coconut_wood")
|
||||
minetest.register_alias("stairs:slab_coconut_wood", "lzr_stairs:slab_coconut_wood_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_coconut_wood", "lzr_stairs:slab_coconut_wood_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_stone", "lzr_stairs:stair_stone")
|
||||
minetest.register_alias("stairs:stair_inner_stone", "lzr_stairs:stair_inner_stone")
|
||||
minetest.register_alias("stairs:stair_outer_stone", "lzr_stairs:stair_outer_stone")
|
||||
minetest.register_alias("stairs:slab_stone", "lzr_stairs:slab_stone_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_stone", "lzr_stairs:slab_stone_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_ocean_stone", "lzr_stairs:stair_ocean_stone")
|
||||
minetest.register_alias("stairs:stair_inner_ocean_stone", "lzr_stairs:stair_inner_ocean_stone")
|
||||
minetest.register_alias("stairs:stair_outer_ocean_stone", "lzr_stairs:stair_outer_ocean_stone")
|
||||
minetest.register_alias("stairs:slab_ocean_stone", "lzr_stairs:slab_ocean_stone_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_ocean_stone", "lzr_stairs:slab_ocean_stone_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_ocean_cobble", "lzr_stairs:stair_ocean_cobble")
|
||||
minetest.register_alias("stairs:stair_inner_ocean_cobble", "lzr_stairs:stair_inner_ocean_cobble")
|
||||
minetest.register_alias("stairs:stair_outer_ocean_cobble", "lzr_stairs:stair_outer_ocean_cobble")
|
||||
minetest.register_alias("stairs:slab_ocean_cobble", "lzr_stairs:slab_ocean_cobble_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_ocean_cobble", "lzr_stairs:slab_ocean_cobble_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_thatch", "lzr_stairs:stair_thatch")
|
||||
minetest.register_alias("stairs:stair_inner_thatch", "lzr_stairs:stair_inner_thatch")
|
||||
minetest.register_alias("stairs:stair_outer_thatch", "lzr_stairs:stair_outer_thatch")
|
||||
minetest.register_alias("stairs:slab_thatch", "lzr_stairs:slab_thatch_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_thatch", "lzr_stairs:slab_thatch_fixed_on_1")
|
||||
minetest.register_alias("stairs:stair_thatch_wet", "lzr_stairs:stair_thatch_wet")
|
||||
minetest.register_alias("stairs:stair_inner_thatch_wet", "lzr_stairs:stair_inner_thatch_wet")
|
||||
minetest.register_alias("stairs:stair_outer_thatch_wet", "lzr_stairs:stair_outer_thatch_wet")
|
||||
minetest.register_alias("stairs:slab_thatch_wet", "lzr_stairs:slab_thatch_wet_fixed")
|
||||
minetest.register_alias("stairs:slab_laser_thatch_wet", "lzr_stairs:slab_thatch_wet_fixed_on_1")
|
||||
dofile(minetest.get_modpath("lzr_stairs").."/register.lua")
|
||||
-- List of node descriptions (only for translation updater scripts)
|
||||
dofile(minetest.get_modpath("lzr_stairs").."/translate.lua")
|
||||
-- Node aliases for backwards-compatibility
|
||||
dofile(minetest.get_modpath("lzr_stairs").."/aliases.lua")
|
||||
|
284
mods/lzr_stairs/register.lua
Normal file
284
mods/lzr_stairs/register.lua
Normal file
@ -0,0 +1,284 @@
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("lzr_stairs")
|
||||
|
||||
-- Same as S, but will be ignored by translation updater scripts
|
||||
local T = S
|
||||
|
||||
-- IMPORTANT: This file does NOT contain the translatable
|
||||
-- node descriptions! This is because node descriptions are
|
||||
-- generated automatically, which is bad for translations,
|
||||
-- so the list of all node names must be manually refreshed
|
||||
-- before each release. See translate.lua for details.
|
||||
|
||||
|
||||
-- If set to true, will print a list of translatable strings
|
||||
-- for the registered nodes to the console so it can
|
||||
-- be copied into this source file.
|
||||
local GENERATE_TRANSLATABLE_STRING_LIST = false
|
||||
|
||||
local function my_register_slab(subname, recipeitem, groups, images,
|
||||
desc_slab, sounds, worldaligntex)
|
||||
lzr_stairs.register_slab(subname, recipeitem, groups, images, desc_slab,
|
||||
sounds, worldaligntex)
|
||||
end
|
||||
-- Local function so we can apply translations
|
||||
local function my_register_stair(subname, recipeitem, groups, images,
|
||||
desc_stair, sounds, worldaligntex)
|
||||
lzr_stairs.register_stair(subname, recipeitem, groups, images, S(desc_stair),
|
||||
sounds, worldaligntex)
|
||||
lzr_stairs.register_stair_inner(subname, recipeitem, groups, images, "",
|
||||
sounds, worldaligntex, T("Inner " .. desc_stair))
|
||||
lzr_stairs.register_stair_outer(subname, recipeitem, groups, images, "",
|
||||
sounds, worldaligntex, T("Outer " .. desc_stair))
|
||||
end
|
||||
local function my_register_stair_and_slab(subname, recipeitem, groups, images,
|
||||
desc_stair, desc_slab, sounds, worldaligntex)
|
||||
my_register_stair(subname, recipeitem, groups, images,
|
||||
desc_stair, sounds, worldaligntex)
|
||||
lzr_stairs.register_slab(subname, recipeitem, groups, images, S(desc_slab),
|
||||
sounds, worldaligntex)
|
||||
|
||||
if GENERATE_TRANSLATABLE_STRING_LIST then
|
||||
for _,x in ipairs({"","Inner ","Outer "}) do
|
||||
print(("S(%q)"):format(x..desc_stair))
|
||||
end
|
||||
print(("S(%q)"):format(desc_slab))
|
||||
end
|
||||
end
|
||||
|
||||
-- Register default stairs and slabs
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"wood",
|
||||
"lzr_core:wood",
|
||||
{breakable=1},
|
||||
{"default_wood.png"},
|
||||
"Wooden Stair",
|
||||
"Wooden Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"wood_mossy",
|
||||
"lzr_core:wood_mossy",
|
||||
{breakable=1},
|
||||
{"lzr_core_wood_mossy.png"},
|
||||
"Mossy Wooden Stair",
|
||||
"Mossy Wooden Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"palm_wood",
|
||||
"lzr_core:palm_wood",
|
||||
{breakable=1},
|
||||
{"lzr_core_palm_wood.png"},
|
||||
"Palm Wood Stair",
|
||||
"Palm Wood Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"coconut_wood",
|
||||
"lzr_core:coconut_wood",
|
||||
{breakable=1},
|
||||
{"lzr_core_coconut_wood.png"},
|
||||
"Coconut Wood Stair",
|
||||
"Coconut Wood Slab",
|
||||
lzr_sounds.node_sound_wood_defaults(),
|
||||
true
|
||||
)
|
||||
|
||||
lzr_stairs.register_slab(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"default_stone_block.png", "default_stone_block.png", "lzr_stairs_stone_block_slab.png"},
|
||||
"Stone Block Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
lzr_stairs.register_stair(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_slab.png^[transformFY","default_stone_block.png","lzr_stairs_stone_block_stair.png^[transformFX","lzr_stairs_stone_block_stair.png","default_stone_block.png","lzr_stairs_stone_block_slab.png"},
|
||||
"Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false
|
||||
)
|
||||
lzr_stairs.register_stair_inner(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_stair_inner_top.png","default_stone_block.png","lzr_stairs_stone_block_stair.png^[transformFX","default_stone_block.png","default_stone_block.png","lzr_stairs_stone_block_stair.png"},
|
||||
"Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Inner Stone Block Stair"
|
||||
)
|
||||
lzr_stairs.register_stair_outer(
|
||||
"stone_block",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_stair_outer_top.png","default_stone_block.png","lzr_stairs_stone_block_stair_outer_right.png","lzr_stairs_stone_block_stair.png","lzr_stairs_stone_block_stair.png^[transformFX","lzr_stairs_stone_block_stair_outer_left.png"},
|
||||
"Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Outer Stone Block Stair"
|
||||
)
|
||||
|
||||
lzr_stairs.register_slab(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"default_stone_block_mossy.png", "default_stone_block_mossy.png", "lzr_stairs_stone_block_mossy_slab.png"},
|
||||
"Mossy Stone Block Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
lzr_stairs.register_stair(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_mossy_slab.png^[transformFY","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair.png^[transformFX","lzr_stairs_stone_block_mossy_stair.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_slab.png"},
|
||||
"Mossy Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false
|
||||
)
|
||||
lzr_stairs.register_stair_inner(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_mossy_stair_inner_top.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair.png^[transformFX","default_stone_block_mossy.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair.png"},
|
||||
"Mossy Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Inner Mossy Stone Block Stair"
|
||||
)
|
||||
lzr_stairs.register_stair_outer(
|
||||
"stone_block_mossy",
|
||||
nil,
|
||||
{breakable=1},
|
||||
{"lzr_stairs_stone_block_mossy_stair_outer_top.png","default_stone_block_mossy.png","lzr_stairs_stone_block_mossy_stair_outer_right.png","lzr_stairs_stone_block_mossy_stair.png","lzr_stairs_stone_block_mossy_stair.png^[transformFX","lzr_stairs_stone_block_mossy_stair_outer_left.png"},
|
||||
"Mossy Stone Block Stair",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
false,
|
||||
"Outer Mossy Stone Block Stair"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"stone",
|
||||
"lzr_core:stone",
|
||||
{breakable=1},
|
||||
{"default_stone.png"},
|
||||
"Stone Stair",
|
||||
"Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"cave_stone",
|
||||
"lzr_core:cave_stone",
|
||||
{breakable=1},
|
||||
{"lzr_core_cave_stone.png"},
|
||||
"Cave Stone Stair",
|
||||
"Cave Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"island_stone",
|
||||
"lzr_core:island_stone",
|
||||
{breakable=1},
|
||||
{"lzr_core_island_stone.png"},
|
||||
"Island Stone Stair",
|
||||
"Island Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"ocean_stone",
|
||||
"lzr_decor:ocean_stone",
|
||||
{breakable=1},
|
||||
{"xocean_stone.png"},
|
||||
"Ocean Stone Stair",
|
||||
"Ocean Stone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"ocean_cobble",
|
||||
"lzr_decor:ocean_cobble",
|
||||
{breakable=1},
|
||||
{"xocean_cobble.png"},
|
||||
"Ocean Cobblestone Stair",
|
||||
"Ocean Cobblestone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"thatch",
|
||||
"lzr_decor:thatch",
|
||||
{breakable=1},
|
||||
{"dryplants_thatch.png"},
|
||||
"Thatch Stair",
|
||||
"Thatch Slab",
|
||||
lzr_sounds.node_sound_leaves_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"thatch_wet",
|
||||
"lzr_decor:thatch_wet",
|
||||
{breakable=1},
|
||||
{"dryplants_thatch_wet.png"},
|
||||
"Wet Thatch Stair",
|
||||
"Wet Thatch Slab",
|
||||
lzr_sounds.node_sound_leaves_defaults(),
|
||||
true
|
||||
)
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"dirt",
|
||||
"lzr_core:dirt",
|
||||
{breakable=1},
|
||||
{"default_dirt.png"},
|
||||
"Dirt Stair",
|
||||
"Dirt Slab",
|
||||
lzr_sounds.node_sound_dirt_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"seabed",
|
||||
"lzr_core:seabed",
|
||||
{breakable=1},
|
||||
{"lzr_core_seabed.png"},
|
||||
"Seabed Stair",
|
||||
"Seabed Slab",
|
||||
lzr_sounds.node_sound_dirt_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"sand",
|
||||
"lzr_core:sand",
|
||||
{breakable=1},
|
||||
{"default_sand.png"},
|
||||
"Sand Stair",
|
||||
"Sand Slab",
|
||||
lzr_sounds.node_sound_sand_defaults(),
|
||||
true
|
||||
)
|
||||
my_register_stair_and_slab(
|
||||
"sandstone",
|
||||
"lzr_core:sandstone",
|
||||
{breakable=1},
|
||||
{"default_sandstone.png"},
|
||||
"Sandstone Stair",
|
||||
"Sandstone Slab",
|
||||
lzr_sounds.node_sound_stone_defaults(),
|
||||
true
|
||||
)
|
||||
|
69
mods/lzr_stairs/translate.lua
Normal file
69
mods/lzr_stairs/translate.lua
Normal file
@ -0,0 +1,69 @@
|
||||
-- Dummy calls to S() to allow translation scripts to detect the strings.
|
||||
-- MUST be updated before release when new nodes have arrived.
|
||||
-- To update this list, do this:
|
||||
-- 1. Set GENERATE_TRANSLATABLE_STRING_LIST in register.lua to true
|
||||
-- 2. Start game
|
||||
-- 3. Paste the console output into this file
|
||||
|
||||
--[[
|
||||
S("Wooden Stair")
|
||||
S("Inner Wooden Stair")
|
||||
S("Outer Wooden Stair")
|
||||
S("Wooden Slab")
|
||||
S("Mossy Wooden Stair")
|
||||
S("Inner Mossy Wooden Stair")
|
||||
S("Outer Mossy Wooden Stair")
|
||||
S("Mossy Wooden Slab")
|
||||
S("Palm Wood Stair")
|
||||
S("Inner Palm Wood Stair")
|
||||
S("Outer Palm Wood Stair")
|
||||
S("Palm Wood Slab")
|
||||
S("Coconut Wood Stair")
|
||||
S("Inner Coconut Wood Stair")
|
||||
S("Outer Coconut Wood Stair")
|
||||
S("Coconut Wood Slab")
|
||||
S("Stone Stair")
|
||||
S("Inner Stone Stair")
|
||||
S("Outer Stone Stair")
|
||||
S("Stone Slab")
|
||||
S("Cave Stone Stair")
|
||||
S("Inner Cave Stone Stair")
|
||||
S("Outer Cave Stone Stair")
|
||||
S("Cave Stone Slab")
|
||||
S("Island Stone Stair")
|
||||
S("Inner Island Stone Stair")
|
||||
S("Outer Island Stone Stair")
|
||||
S("Island Stone Slab")
|
||||
S("Ocean Stone Stair")
|
||||
S("Inner Ocean Stone Stair")
|
||||
S("Outer Ocean Stone Stair")
|
||||
S("Ocean Stone Slab")
|
||||
S("Ocean Cobblestone Stair")
|
||||
S("Inner Ocean Cobblestone Stair")
|
||||
S("Outer Ocean Cobblestone Stair")
|
||||
S("Ocean Cobblestone Slab")
|
||||
S("Thatch Stair")
|
||||
S("Inner Thatch Stair")
|
||||
S("Outer Thatch Stair")
|
||||
S("Thatch Slab")
|
||||
S("Wet Thatch Stair")
|
||||
S("Inner Wet Thatch Stair")
|
||||
S("Outer Wet Thatch Stair")
|
||||
S("Wet Thatch Slab")
|
||||
S("Dirt Stair")
|
||||
S("Inner Dirt Stair")
|
||||
S("Outer Dirt Stair")
|
||||
S("Dirt Slab")
|
||||
S("Seabed Stair")
|
||||
S("Inner Seabed Stair")
|
||||
S("Outer Seabed Stair")
|
||||
S("Seabed Slab")
|
||||
S("Sand Stair")
|
||||
S("Inner Sand Stair")
|
||||
S("Outer Sand Stair")
|
||||
S("Sand Slab")
|
||||
S("Sandstone Stair")
|
||||
S("Inner Sandstone Stair")
|
||||
S("Outer Sandstone Stair")
|
||||
S("Sandstone Slab")
|
||||
]]
|
Loading…
x
Reference in New Issue
Block a user