master
rnd1 2016-06-14 08:32:02 +02:00
parent 6d0eca38eb
commit f232616822
1 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,7 @@ function minetest.is_protected(pos, digger)
local is_protected = old_is_protected(pos, digger);
if is_protected then -- only if protected
local p = {x=math.floor((pos.x)/20)*20,y=math.floor((pos.y)/20)*20,z=math.floor((pos.z)/20)*20}
local p = {x=math.floor((pos.x)/20)*20,y=math.floor((pos.y)/20)*20+1,z=math.floor((pos.z)/20)*20}
if minetest.get_node(p).name == "basic_machines:distributor" then -- attempt to activate distributor at special grid location: coordinates of the form 10+20*i
local meta = minetest.get_meta(p);
if meta:get_int("active1") == 0 then -- first output is disabled, indicating ready to be used as event handler
@ -30,7 +30,8 @@ end
minetest.register_on_chat_message(function(name, message)
local player = minetest.get_player_by_name(name);
local pos = player:getpos();
local p = {x=math.floor((pos.x)/20)*20,y=math.floor((pos.y)/20)*20,z=math.floor((pos.z)/20)*20}
local p = {x=math.floor((pos.x)/20)*20,y=math.floor((pos.y)/20)*20+1,z=math.floor((pos.z)/20)*20}
--minetest.chat_send_all(minetest.pos_to_string(p))
if minetest.get_node(p).name == "basic_machines:distributor" then -- attempt to activate distributor at special grid location: coordinates of the form 10+20*i
local meta = minetest.get_meta(p);
if meta:get_int("active1") == 0 then -- first output is disabled, indicating ready to be used as event handler