2 footstep = { "Footstep Sound Node", "soundstuff_node_footstep.png" },
3 dig = { "Dig Sound Node", "soundstuff_node_dig.png" },
4 dug = { "Dug Sound Node", "soundstuff_node_dug.png" },
5 place = { "Place Sound Node", "soundstuff_node_place.png" },
6 place_failed = { "Place Failed Sound Node", "soundstuff_node_place_failed.png" },
9 for k,v in pairs(simple_nodes) do
10 minetest.register_node("soundstuff:"..k, {
12 tiles = {"soundstuff_node_sound.png","soundstuff_node_sound.png",v[2]},
13 groups = {dig_immediate=2},
15 [k] = { name = "soundstuff_mono", gain = 1.0 },
20 minetest.register_node("soundstuff:place_failed_attached", {
21 description = "Attached Place Failed Sound Node",
22 tiles = {"soundstuff_node_sound.png", "soundstuff_node_sound.png", "soundstuff_node_place_failed.png"},
23 groups = {dig_immediate=2, attached_node=1},
26 node_box = { type = "fixed", fixed = {
27 { -7/16, -7/16, -7/16, 7/16, 7/16, 7/16 },
28 { -0.5, -0.5, -0.5, 0.5, -7/16, 0.5 },
31 place_failed = { name = "soundstuff_mono", gain = 1.0 },
35 minetest.register_node("soundstuff:fall", {
36 description = "Fall Sound Node",
37 tiles = {"soundstuff_node_sound.png", "soundstuff_node_sound.png", "soundstuff_node_fall.png"},
38 groups = {dig_immediate=2, falling_node=1},
40 fall = { name = "soundstuff_mono", gain = 1.0 },
44 minetest.register_node("soundstuff:fall_attached", {
45 description = "Attached Fall Sound Node",
46 tiles = {"soundstuff_node_sound.png", "soundstuff_node_sound.png", "soundstuff_node_fall.png"},
47 groups = {dig_immediate=2, attached_node=1},
50 node_box = { type = "fixed", fixed = {
51 { -7/16, -7/16, -7/16, 7/16, 7/16, 7/16 },
52 { -0.5, -0.5, -0.5, 0.5, -7/16, 0.5 },
55 fall = { name = "soundstuff_mono", gain = 1.0 },
59 minetest.register_node("soundstuff:footstep_liquid", {
60 description = "Liquid Footstep Sound Node",
63 "soundstuff_node_sound.png^[colorize:#0000FF:127",
66 {name = "soundstuff_node_sound.png^[colorize:#0000FF:127", backface_culling = false},
67 {name = "soundstuff_node_sound.png^[colorize:#0000FF:127", backface_culling = true},
69 liquids_pointable = true,
70 liquidtype = "source",
71 liquid_alternative_flowing = "soundstuff:footstep_liquid",
72 liquid_alternative_source = "soundstuff:footstep_liquid",
73 liquid_renewable = false,
82 is_ground_content = false,
83 post_effect_color = {a = 64, r = 0, g = 0, b = 200},
85 footstep = { name = "soundstuff_mono", gain = 1.0 },
89 minetest.register_node("soundstuff:footstep_climbable", {
90 description = "Climbable Footstep Sound Node",
91 drawtype = "allfaces",
93 "soundstuff_node_climbable.png",
97 sunlight_propagates = true,
100 is_ground_content = false,
101 groups = { dig_immediate = 2 },
103 footstep = { name = "soundstuff_mono", gain = 1.0 },
109 minetest.register_craftitem("soundstuff:eat", {
110 description = "Eat Sound Item".."\n"..
111 "Makes a sound when 'eaten' (with punch key)",
112 inventory_image = "soundstuff_eat.png",
113 on_use = minetest.item_eat(0),
115 eat = { name = "soundstuff_mono", gain = 1.0 },
119 minetest.register_tool("soundstuff:breaks", {
120 description = "Break Sound Tool".."\n"..
121 "Digs cracky=3 and more".."\n"..
122 "Makes a sound when it breaks",
123 inventory_image = "soundstuff_node_dug.png",
125 breaks = { name = "soundstuff_mono", gain = 1.0 },
127 tool_capabilities = {
130 cracky={times={[2]=2.00, [3]=1.20}, uses=1, maxlevel=0},
131 choppy={times={[2]=2.00, [3]=1.20}, uses=1, maxlevel=0},
132 snappy={times={[2]=2.00, [3]=1.20}, uses=1, maxlevel=0},
133 crumbly={times={[2]=2.00, [3]=1.20}, uses=1, maxlevel=0},
138 -- Plays sound repeatedly
139 minetest.register_node("soundstuff:positional", {
140 description = "Positional Sound Node",
141 on_construct = function(pos)
142 local timer = minetest.get_node_timer(pos)
145 on_timer = function(pos, elapsed)
146 local node = minetest.get_node(pos)
147 local dist = node.param2
151 minetest.sound_play("soundstuff_mono", { pos = pos, max_hear_distance = dist })
152 local timer = minetest.get_node_timer(pos)
155 on_rightclick = function(pos, node, clicker)
156 node.param2 = (node.param2 + 1) % 64
157 minetest.set_node(pos, node)
158 if clicker and clicker:is_player() then
159 local dist = node.param2
162 diststr = "<default>"
164 diststr = tostring(dist)
166 minetest.chat_send_player(clicker:get_player_name(), "max_hear_distance = " .. diststr)
170 groups = { dig_immediate = 2 },
171 tiles = { "soundstuff_node_sound.png" },