From 843dbd227658a93ee4df791bfdd3d136ee7adf85 Mon Sep 17 00:00:00 2001 From: tuedel Date: Wed, 12 Aug 2020 21:15:36 +0200 Subject: [PATCH] Replace deprecated function calls (#70) --- entities.lua | 4 ++-- nodes/node_item_ejector.lua | 2 +- util.lua | 2 +- util_execute_cycle.lua | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/entities.lua b/entities.lua index 1a95cf6..d203bd9 100644 --- a/entities.lua +++ b/entities.lua @@ -118,9 +118,9 @@ minetest.register_entity("digtron:builder_item", { on_activate = function(self, staticdata) local props = self.object:get_properties() if staticdata ~= nil and staticdata ~= "" then - local pos = self.object:getpos() + local pos = self.object:get_pos() local node = minetest.get_node(pos) - if minetest.get_node_group(node.name, "digtron") ~= 4 then + if minetest.get_item_group(node.name, "digtron") ~= 4 then -- We were reactivated without a builder node on our location, self-destruct self.object:remove() return diff --git a/nodes/node_item_ejector.lua b/nodes/node_item_ejector.lua index 55d3607..be71537 100644 --- a/nodes/node_item_ejector.lua +++ b/nodes/node_item_ejector.lua @@ -41,7 +41,7 @@ local function eject_items(pos, node, player, eject_even_without_pipeworks, layo local insert_into_pipe = false local eject_into_world = false - if pipeworks_path and minetest.get_node_group(destination_node_name, "tubedevice") > 0 then + if pipeworks_path and minetest.get_item_group(destination_node_name, "tubedevice") > 0 then insert_into_pipe = true elseif eject_even_without_pipeworks then if destination_node_def and not destination_node_def.walkable then diff --git a/util.lua b/util.lua index 7030184..25e87da 100644 --- a/util.lua +++ b/util.lua @@ -282,7 +282,7 @@ digtron.tap_batteries = function(battery_positions, target, test) end digtron.remove_builder_item = function(pos) - local objects = minetest.env:get_objects_inside_radius(pos, 0.5) + local objects = minetest.get_objects_inside_radius(pos, 0.5) if objects ~= nil then for _, obj in ipairs(objects) do if obj and obj:get_luaentity() and obj:get_luaentity().name == "digtron:builder_item" then diff --git a/util_execute_cycle.lua b/util_execute_cycle.lua index 900fd0f..7c36ae2 100644 --- a/util_execute_cycle.lua +++ b/util_execute_cycle.lua @@ -71,7 +71,7 @@ end -- Checks if a player is within a layout's extents. local function move_player_test(layout, player) - local player_pos = player:getpos() + local player_pos = player:get_pos() if player_pos.x >= layout.extents_min_x - 1 and player_pos.x <= layout.extents_max_x + 1 and player_pos.y >= layout.extents_min_y - 1 and player_pos.y <= layout.extents_max_y + 1 and player_pos.z >= layout.extents_min_z - 1 and player_pos.z <= layout.extents_max_z + 1 then @@ -310,7 +310,7 @@ digtron.execute_dig_cycle = function(pos, clicker) pos = vector.add(pos, dir) meta = minetest.get_meta(pos) if move_player then - clicker:moveto(vector.add(dir, clicker:getpos()), true) + clicker:moveto(vector.add(dir, clicker:get_pos()), true) end -- store or drop the products of the digger heads @@ -449,7 +449,7 @@ digtron.execute_move_cycle = function(pos, clicker) pos = vector.add(pos, dir) if move_player then - clicker:moveto(vector.add(clicker:getpos(), dir), true) + clicker:moveto(vector.add(clicker:get_pos(), dir), true) end return pos, "", 0 end @@ -569,7 +569,7 @@ digtron.execute_downward_dig_cycle = function(pos, clicker) pos = vector.add(pos, dir) meta = minetest.get_meta(pos) if move_player then - clicker:moveto(vector.add(clicker:getpos(), dir), true) + clicker:moveto(vector.add(clicker:get_pos(), dir), true) end -- store or drop the products of the digger heads