From 9bf25214bee74da17cab1fa5272ce004c7113445 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 9 Jan 2018 17:44:54 +0100 Subject: [PATCH] Doors register redstone signal on top part, too --- mods/ITEMS/mcl_doors/api_doors.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_doors/api_doors.lua b/mods/ITEMS/mcl_doors/api_doors.lua index c3c32c9a95..42490731a2 100644 --- a/mods/ITEMS/mcl_doors/api_doors.lua +++ b/mods/ITEMS/mcl_doors/api_doors.lua @@ -177,13 +177,18 @@ function mcl_doors:register_door(name, def) minetest.sound_play(door_switching_sound, {pos = pos, gain = 0.5, max_hear_distance = 16}) end - local function on_mesecons_signal_open (pos, node) + local function on_mesecons_signal_open(pos, node) on_open_close(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0}) end - - local function on_mesecons_signal_close (pos, node) + local function on_mesecons_signal_close(pos, node) on_open_close(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) end + local function on_mesecons_signal_open_top(pos, node) + on_mesecons_signal_open({x=pos.x, y=pos.y-1, z=pos.z}, node) + end + local function on_mesecons_signal_close_top(pos, node) + on_mesecons_signal_close({x=pos.x, y=pos.y-1, z=pos.z}, node) + end local function check_player_priv(pos, player) if not def.only_placer_can_open then @@ -281,6 +286,10 @@ function mcl_doors:register_door(name, def) on_rightclick = on_rightclick, + mesecons = { effector = { + action_on = on_mesecons_signal_open_top + }}, + can_dig = check_player_priv, }) @@ -371,6 +380,10 @@ function mcl_doors:register_door(name, def) on_rightclick = on_rightclick, + mesecons = { effector = { + action_on = on_mesecons_signal_close_top + }}, + can_dig = check_player_priv, })