1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

Add sounds to stairs and slabs

This commit is contained in:
PilzAdam 2012-12-12 20:37:33 +01:00
parent 4763fa635a
commit c4f2bee9a6

View File

@ -4,7 +4,7 @@
stairs = {} stairs = {}
-- Node will be called stairs:stair_<subname> -- Node will be called stairs:stair_<subname>
function stairs.register_stair(subname, recipeitem, groups, images, description) function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
minetest.register_node("stairs:stair_" .. subname, { minetest.register_node("stairs:stair_" .. subname, {
description = description, description = description,
drawtype = "nodebox", drawtype = "nodebox",
@ -13,6 +13,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description)
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = true, is_ground_content = true,
groups = groups, groups = groups,
sounds = sounds,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -43,7 +44,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description)
end end
-- Node will be called stairs:slab_<subname> -- Node will be called stairs:slab_<subname>
function stairs.register_slab(subname, recipeitem, groups, images, description) function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
minetest.register_node("stairs:slab_" .. subname, { minetest.register_node("stairs:slab_" .. subname, {
description = description, description = description,
drawtype = "nodebox", drawtype = "nodebox",
@ -51,6 +52,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description)
paramtype = "light", paramtype = "light",
is_ground_content = true, is_ground_content = true,
groups = groups, groups = groups,
sounds = sounds,
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
@ -107,37 +109,42 @@ function stairs.register_slab(subname, recipeitem, groups, images, description)
end end
-- Nodes will be called stairs:{stair,slab}_<subname> -- Nodes will be called stairs:{stair,slab}_<subname>
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab) function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
stairs.register_stair(subname, recipeitem, groups, images, desc_stair) stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
stairs.register_slab(subname, recipeitem, groups, images, desc_slab) stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
end end
stairs.register_stair_and_slab("wood", "default:wood", stairs.register_stair_and_slab("wood", "default:wood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2}, {snappy=2,choppy=2,oddly_breakable_by_hand=2},
{"default_wood.png"}, {"default_wood.png"},
"Wooden stair", "Wooden stair",
"Wooden slab") "Wooden slab",
default.node_sound_wood_defaults())
stairs.register_stair_and_slab("stone", "default:stone", stairs.register_stair_and_slab("stone", "default:stone",
{cracky=3}, {cracky=3},
{"default_stone.png"}, {"default_stone.png"},
"Stone stair", "Stone stair",
"Stone slab") "Stone slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("cobble", "default:cobble", stairs.register_stair_and_slab("cobble", "default:cobble",
{cracky=3}, {cracky=3},
{"default_cobble.png"}, {"default_cobble.png"},
"Cobble stair", "Cobble stair",
"Cobble slab") "Cobble slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("brick", "default:brick", stairs.register_stair_and_slab("brick", "default:brick",
{cracky=3}, {cracky=3},
{"default_brick.png"}, {"default_brick.png"},
"Brick stair", "Brick stair",
"Brick slab") "Brick slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("sandstone", "default:sandstone", stairs.register_stair_and_slab("sandstone", "default:sandstone",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"default_sandstone.png"}, {"default_sandstone.png"},
"Sandstone stair", "Sandstone stair",
"Sandstone slab") "Sandstone slab",
default.node_sound_stone_defaults())