From ad74a7257e4fd3a55eba0659f32b45429dcf7d2e Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sat, 28 Mar 2015 00:03:38 -0400 Subject: [PATCH] punch the large speaker to take its cover off or put it on --- homedecor/electronics.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homedecor/electronics.lua b/homedecor/electronics.lua index 678d6433..fcf52333 100644 --- a/homedecor/electronics.lua +++ b/homedecor/electronics.lua @@ -11,6 +11,9 @@ homedecor.register("speaker", { }, groups = { snappy = 3 }, sounds = default.node_sound_leaves_defaults(), + on_punch = function(pos, node, puncher, pointed_thing) + minetest.set_node(pos, {name = "homedecor:speaker_open", param2 = node.param2}) + end }) homedecor.register("speaker_open", { @@ -23,6 +26,9 @@ homedecor.register("speaker_open", { }, groups = { snappy = 3 }, sounds = default.node_sound_leaves_defaults(), + on_punch = function(pos, node, puncher, pointed_thing) + minetest.set_node(pos, {name = "homedecor:speaker", param2 = node.param2}) + end }) local spk_cbox = {