From c009dd24663eac4fdf25e3488d1b95a5d5036440 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 11 Mar 2017 06:17:35 +0100 Subject: [PATCH] Noteblocks play current sound when punched --- mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua index 79c29da41b..75a115ec6f 100644 --- a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua @@ -6,11 +6,14 @@ minetest.register_node("mesecons_noteblock:noteblock", { groups = {handy=1,axey=1, material_wood=1}, is_ground_content = false, 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 mesecon.noteblock_play(pos, node.param2) minetest.set_node(pos, node) 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(), mesecons = {effector = { -- play sound when activated action_on = function (pos, node)