1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Builtin: Replace deprecated function calls (#7561)

This commit is contained in:
SmallJoker 2018-07-17 20:17:54 +02:00 committed by GitHub
parent a0635f6024
commit ade7a1cbcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 19 deletions

View file

@ -33,7 +33,7 @@ function core.get_pointed_thing_position(pointed_thing, above)
-- The position where a node would be dug
return pointed_thing.under
elseif pointed_thing.type == "object" then
return pointed_thing.ref and pointed_thing.ref:getpos()
return pointed_thing.ref and pointed_thing.ref:get_pos()
end
end
@ -331,7 +331,7 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
-- Calculate the direction for furnaces and chests and stuff
elseif (def.paramtype2 == "facedir" or
def.paramtype2 == "colorfacedir") and not param2 then
local placer_pos = placer and placer:getpos()
local placer_pos = placer and placer:get_pos()
if placer_pos then
local dir = {
x = above.x - placer_pos.x,
@ -478,7 +478,7 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
if inv and inv:room_for_item("main", {name=replace_with_item}) then
inv:add_item("main", replace_with_item)
else
local pos = user:getpos()
local pos = user:get_pos()
pos.y = math.floor(pos.y + 0.5)
core.add_item(pos, replace_with_item)
end