Replace deprecated function calls (#70)

This commit is contained in:
tuedel 2020-08-12 21:15:36 +02:00 committed by GitHub
parent 1c85c822e8
commit 843dbd2276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

@ -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

@ -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

@ -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

@ -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