From b2f959328c685d42e2ea3b0ec1aa8d37797d009d Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Thu, 13 Feb 2014 20:45:31 +0000 Subject: [PATCH] Update deprecated api calls --- digilines/internal.lua | 6 +++--- digilines/wires_common.lua | 4 ++-- digilines_lcd/init.lua | 18 +++++++++--------- digilines_lightsensor/init.lua | 8 ++++---- digilines_rtc/init.lua | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/digilines/internal.lua b/digilines/internal.lua index ce4012c..5226cfb 100644 --- a/digilines/internal.lua +++ b/digilines/internal.lua @@ -14,7 +14,7 @@ function digiline:importrules(spec, node) end function digiline:getAnyInputRules(pos) - local node = minetest.env:get_node(pos) + local node = minetest.get_node(pos) spec = digiline:getspec(node) if not spec then return end @@ -29,7 +29,7 @@ function digiline:getAnyInputRules(pos) end function digiline:getAnyOutputRules(pos) - local node = minetest.env:get_node(pos) + local node = minetest.get_node(pos) spec = digiline:getspec(node) if not spec then return end @@ -71,7 +71,7 @@ function digiline:transmit(pos, channel, msg, checked) if checked[checkedid] then return checked end checked[checkedid] = true - local node = minetest.env:get_node(pos) + local node = minetest.get_node(pos) local spec = digiline:getspec(node) if not spec then return end diff --git a/digilines/wires_common.lua b/digilines/wires_common.lua index 4370241..eac28d9 100644 --- a/digilines/wires_common.lua +++ b/digilines/wires_common.lua @@ -42,7 +42,7 @@ function digiline:update_autoconnect(pos, secondcall) digiline:update_autoconnect(zmympos, true) end - local digilinespec = minetest.registered_nodes[minetest.env:get_node(pos).name].digiline + local digilinespec = minetest.registered_nodes[minetest.get_node(pos).name].digiline if not digilinespec then return nil end if not digilinespec.wire then return nil end @@ -80,5 +80,5 @@ function digiline:update_autoconnect(pos, secondcall) tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy) - minetest.env:set_node(pos, {name = digilinespec.wire.basename..nodeid}) + minetest.set_node(pos, {name = digilinespec.wire.basename..nodeid}) end diff --git a/digilines_lcd/init.lua b/digilines_lcd/init.lua index 447f01f..57c1cda 100644 --- a/digilines_lcd/init.lua +++ b/digilines_lcd/init.lua @@ -33,11 +33,11 @@ local lcds = { } local reset_meta = function(pos) - minetest.env:get_meta(pos):set_string("formspec", "field[channel;Channel;${channel}]") + minetest.get_meta(pos):set_string("formspec", "field[channel;Channel;${channel}]") end local clearscreen = function(pos) - local objects = minetest.env:get_objects_inside_radius(pos, 0.5) + local objects = minetest.get_objects_inside_radius(pos, 0.5) for _, o in ipairs(objects) do if o:get_entity_name() == "digilines_lcd:text" then o:remove() @@ -46,9 +46,9 @@ local clearscreen = function(pos) end local prepare_writing = function (pos) - lcd_info = lcds[minetest.env:get_node(pos).param2] + lcd_info = lcds[minetest.get_node(pos).param2] if lcd_info == nil then return end - local text = minetest.env:add_entity( + local text = minetest.add_entity( {x = pos.x + lcd_info.delta.x, y = pos.y + lcd_info.delta.y, z = pos.z + lcd_info.delta.z}, "digilines_lcd:text") @@ -58,7 +58,7 @@ local prepare_writing = function (pos) end local on_digiline_receive = function(pos, node, channel, msg) - local setchan = minetest.env:get_meta(pos):get_string("channel") + local setchan = minetest.get_meta(pos):get_string("channel") if setchan ~= channel then return end clearscreen(pos) @@ -86,9 +86,9 @@ minetest.register_node("digilines_lcd:lcd", { groups = {choppy = 3, dig_immediate = 2}, after_place_node = function (pos, placer, itemstack) - local param2 = minetest.env:get_node(pos).param2 + local param2 = minetest.get_node(pos).param2 if param2 == 0 or param2 == 1 then - minetest.env:add_node(pos, {name = "digilines_lcd:lcd", param2 = 3}) + minetest.add_node(pos, {name = "digilines_lcd:lcd", param2 = 3}) end prepare_writing (pos) end, @@ -102,7 +102,7 @@ minetest.register_node("digilines_lcd:lcd", { end, on_receive_fields = function(pos, formname, fields, sender) - minetest.env:get_meta(pos):set_string("channel", fields.channel) + minetest.get_meta(pos):set_string("channel", fields.channel) end, digiline = @@ -122,7 +122,7 @@ minetest.register_entity("digilines_lcd:text", { textures = {}, on_activate = function(self) - local meta = minetest.env:get_meta(self.object:getpos()) + local meta = minetest.get_meta(self.object:getpos()) local text = meta:get_string("text") self.object:set_properties({textures={generate_texture(create_lines(text))}}) end diff --git a/digilines_lightsensor/init.lua b/digilines_lightsensor/init.lua index 8db748e..2bbbc27 100644 --- a/digilines_lightsensor/init.lua +++ b/digilines_lightsensor/init.lua @@ -22,9 +22,9 @@ local lsensor_selbox = } local on_digiline_receive = function (pos, node, channel, msg) - local setchan = minetest.env:get_meta(pos):get_string("channel") + local setchan = minetest.get_meta(pos):get_string("channel") if channel == setchan and msg == GET_COMMAND then - local lightval = minetest.env:get_node_light(pos) + local lightval = minetest.get_node_light(pos) digiline:receptor_send(pos, digiline.rules.default, channel, lightval) end end @@ -46,11 +46,11 @@ minetest.register_node("digilines_lightsensor:lightsensor", { }, }, on_construct = function(pos) - local meta = minetest.env:get_meta(pos) + local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[channel;Channel;${channel}]") end, on_receive_fields = function(pos, formname, fields, sender) - local meta = minetest.env:get_meta(pos) + local meta = minetest.get_meta(pos) fields.channel = fields.channel or "" meta:set_string("channel", fields.channel) end, diff --git a/digilines_rtc/init.lua b/digilines_rtc/init.lua index b2b21ec..40e84d0 100644 --- a/digilines_rtc/init.lua +++ b/digilines_rtc/init.lua @@ -17,9 +17,9 @@ local rtc_selbox = } local on_digiline_receive = function (pos, node, channel, msg) - local setchan = minetest.env:get_meta(pos):get_string("channel") + local setchan = minetest.get_meta(pos):get_string("channel") if channel == setchan and msg == GET_COMMAND then - local timeofday = minetest.env:get_timeofday() + local timeofday = minetest.get_timeofday() digiline:receptor_send(pos, digiline.rules.default, channel, timeofday) end end @@ -42,11 +42,11 @@ minetest.register_node("digilines_rtc:rtc", { }, }, on_construct = function(pos) - local meta = minetest.env:get_meta(pos) + local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[channel;Channel;${channel}]") end, on_receive_fields = function(pos, formname, fields, sender) - local meta = minetest.env:get_meta(pos) + local meta = minetest.get_meta(pos) fields.channel = fields.channel or "" meta:set_string("channel", fields.channel) end,