forked from Mineclonia/Mineclonia
Noteblocks play current sound when punched
This commit is contained in:
parent
1466c87e7a
commit
c009dd2466
|
@ -6,11 +6,14 @@ minetest.register_node("mesecons_noteblock:noteblock", {
|
||||||
groups = {handy=1,axey=1, material_wood=1},
|
groups = {handy=1,axey=1, material_wood=1},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
place_param2 = 0,
|
place_param2 = 0,
|
||||||
on_rightclick = function (pos, node) -- change sound when punched
|
on_rightclick = function (pos, node) -- change sound when rightclicked
|
||||||
node.param2 = (node.param2+1)%24
|
node.param2 = (node.param2+1)%24
|
||||||
mesecon.noteblock_play(pos, node.param2)
|
mesecon.noteblock_play(pos, node.param2)
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
end,
|
end,
|
||||||
|
on_punch = function (pos, node) -- play current sound when punched
|
||||||
|
mesecon.noteblock_play(pos, node.param2)
|
||||||
|
end,
|
||||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||||
mesecons = {effector = { -- play sound when activated
|
mesecons = {effector = { -- play sound when activated
|
||||||
action_on = function (pos, node)
|
action_on = function (pos, node)
|
||||||
|
|
Loading…
Reference in New Issue