summaryrefslogtreecommitdiff
path: root/mesecons_detector/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons_detector/init.lua')
-rw-r--r--mesecons_detector/init.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesecons_detector/init.lua b/mesecons_detector/init.lua
index 2eaa1e0..2600597 100644
--- a/mesecons_detector/init.lua
+++ b/mesecons_detector/init.lua
@@ -3,14 +3,14 @@
-- The radius can be specified in mesecons/settings.lua
local object_detector_make_formspec = function (pos)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[9,2.5]" ..
"field[0.3, 0;9,2;scanname;Name of player to scan for (empty for any):;${scanname}]"..
"field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]")
end
local object_detector_on_receive_fields = function (pos, formname, fields)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
meta:set_string("scanname", fields.scanname)
meta:set_string("digiline_channel", fields.digiline_channel)
object_detector_make_formspec(pos)
@@ -18,10 +18,10 @@ end
-- returns true if player was found, false if not
local object_detector_scan = function (pos)
- local objs = minetest.env:get_objects_inside_radius(pos, OBJECT_DETECTOR_RADIUS)
+ local objs = minetest.get_objects_inside_radius(pos, OBJECT_DETECTOR_RADIUS)
for k, obj in pairs(objs) do
local isname = obj:get_player_name() -- "" is returned if it is not a player; "" ~= nil!
- local scanname = minetest.env:get_meta(pos):get_string("scanname")
+ local scanname = minetest.get_meta(pos):get_string("scanname")
if (isname == scanname and isname ~= "") or (isname ~= "" and scanname == "") then -- player with scanname found or not scanname specified
return true
end
@@ -33,7 +33,7 @@ end
object_detector_digiline = {
effector = {
action = function (pos, node, channel, msg)
- local meta = minetest.env:get_meta(pos)
+ local meta = minetest.get_meta(pos)
local active_channel = meta:get_string("digiline_channel")
if channel == active_channel then
meta:set_string("scanname", msg)