From 71a52de5576f2fd327e95495fdd956a1dad121d0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 5 Feb 2017 17:57:33 +0100 Subject: [PATCH] Make redstone stuff operable on rightclick --- mods/redstone/mesecons_button/init.lua | 2 +- mods/redstone/mesecons_delayer/init.lua | 4 ++-- mods/redstone/mesecons_noteblock/init.lua | 4 ++-- mods/redstone/mesecons_walllever/init.lua | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mods/redstone/mesecons_button/init.lua b/mods/redstone/mesecons_button/init.lua index f6ce39fd84..76cbd2cd6d 100644 --- a/mods/redstone/mesecons_button/init.lua +++ b/mods/redstone/mesecons_button/init.lua @@ -38,7 +38,7 @@ minetest.register_node("mesecons_button:button_stone_off", { }, groups = {dig_immediate=2, attached_node=1, dig_by_water=1}, description = "Stone Button", - on_rightclick= function (pos, node) + on_rightclick = function (pos, node) mesecon:swap_node(pos, "mesecons_button:button_stone_on") mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_button_push", {pos=pos}) diff --git a/mods/redstone/mesecons_delayer/init.lua b/mods/redstone/mesecons_delayer/init.lua index 580e9d5d4a..b518a7d1ae 100644 --- a/mods/redstone/mesecons_delayer/init.lua +++ b/mods/redstone/mesecons_delayer/init.lua @@ -112,7 +112,7 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), { sunlight_propagates = true, is_ground_content = false, drop = 'mesecons_delayer:delayer_off_1', - on_punch = function (pos, node) + on_rightclick = function (pos, node) if node.name=="mesecons_delayer:delayer_off_1" then mesecon:swap_node(pos,"mesecons_delayer:delayer_off_2") elseif node.name=="mesecons_delayer:delayer_off_2" then @@ -167,7 +167,7 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), { sunlight_propagates = true, is_ground_content = false, drop = 'mesecons_delayer:delayer_off_1', - on_punch = function (pos, node) + on_rightclick = function (pos, node) if node.name=="mesecons_delayer:delayer_on_1" then mesecon:swap_node(pos,"mesecons_delayer:delayer_on_2") elseif node.name=="mesecons_delayer:delayer_on_2" then diff --git a/mods/redstone/mesecons_noteblock/init.lua b/mods/redstone/mesecons_noteblock/init.lua index 08771e9cfb..1ed128ab3e 100644 --- a/mods/redstone/mesecons_noteblock/init.lua +++ b/mods/redstone/mesecons_noteblock/init.lua @@ -1,7 +1,7 @@ minetest.register_node("mesecons_noteblock:noteblock", { description = "Note Block", tiles = {"mesecons_noteblock.png"}, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + groups = {choppy=2,oddly_breakable_by_hand=2}, drawtype = "allfaces_optional", visual_scale = 1.3, paramtype="light", @@ -9,7 +9,7 @@ minetest.register_node("mesecons_noteblock:noteblock", { after_place_node = function(pos) minetest.add_node(pos, {name="mesecons_noteblock:noteblock", param2=0}) end, - on_punch = function (pos, node) -- change sound when punched + on_rightclick = function (pos, node) -- change sound when punched local param2 = node.param2+1 if param2==12 then param2=0 end minetest.add_node(pos, {name = node.name, param2 = param2}) diff --git a/mods/redstone/mesecons_walllever/init.lua b/mods/redstone/mesecons_walllever/init.lua index cda3ab2456..f632810d4a 100644 --- a/mods/redstone/mesecons_walllever/init.lua +++ b/mods/redstone/mesecons_walllever/init.lua @@ -30,7 +30,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { groups = {dig_immediate=2, dig_by_water=1}, is_ground_content = false, description="Lever", - on_punch = function (pos, node) + on_rightclick = function (pos, node) mesecon:swap_node(pos, "mesecons_walllever:wall_lever_on") mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_lever", {pos=pos}) @@ -70,7 +70,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", { is_ground_content = false, drop = '"mesecons_walllever:wall_lever_off" 1', description="Lever", - on_punch = function (pos, node) + on_rightclick = function (pos, node) mesecon:swap_node(pos, "mesecons_walllever:wall_lever_off") mesecon:receptor_off(pos, mesecon.rules.buttonlike_get(node)) minetest.sound_play("mesecons_lever", {pos=pos})