Skip to content

Commit

Permalink
Replace deprecated function calls (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuedel committed Aug 12, 2020
1 parent 1c85c82 commit 843dbd2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nodes/node_item_ejector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions util_execute_cycle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 843dbd2

Please sign in to comment.