end
teleportee = core.get_player_by_name(name)
if teleportee then
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting to "..core.pos_to_string(p)
end
end
if target_name then
local target = core.get_player_by_name(target_name)
if target then
- p = target:getpos()
+ p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting to " .. target_name
.. " at "..core.pos_to_string(p)
end
teleportee = core.get_player_by_name(teleportee_name)
end
if teleportee and p.x and p.y and p.z then
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting " .. teleportee_name
.. " to " .. core.pos_to_string(p)
end
if target_name then
local target = core.get_player_by_name(target_name)
if target then
- p = target:getpos()
+ p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
- teleportee:setpos(p)
+ teleportee:set_pos(p)
return true, "Teleporting " .. teleportee_name
.. " to " .. target_name
.. " at " .. core.pos_to_string(p)
return false, "Cannot spawn an unknown entity"
end
if p == "" then
- p = player:getpos()
+ p = player:get_pos()
else
p = core.string_to_pos(p)
if p == nil then
on_step = function(self, dtime)
-- Set gravity
- local acceleration = self.object:getacceleration()
+ local acceleration = self.object:get_acceleration()
if not vector.equals(acceleration, {x = 0, y = -10, z = 0}) then
- self.object:setacceleration({x = 0, y = -10, z = 0})
+ self.object:set_acceleration({x = 0, y = -10, z = 0})
end
-- Turn to actual node when colliding with ground, or continue to move
- local pos = self.object:getpos()
+ local pos = self.object:get_pos()
-- Position of bottom center point
local bcp = {x = pos.x, y = pos.y - 0.7, z = pos.z}
-- 'bcn' is nil for unloaded nodes
core.check_for_falling(np)
return
end
- local vel = self.object:getvelocity()
+ local vel = self.object:get_velocity()
if vector.equals(vel, {x = 0, y = 0, z = 0}) then
- local npos = self.object:getpos()
- self.object:setpos(vector.round(npos))
+ local npos = self.object:get_pos()
+ self.object:set_pos(vector.round(npos))
end
end
})
-- 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
-- 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,
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
return
end
- local vel = self.object:getvelocity()
+ local vel = self.object:get_velocity()
local def = node and core.registered_nodes[node.name]
local is_moving = (def and not def.walkable) or
vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0
return nil
end
- local p1 = player:getpos()
+ local p1 = player:get_pos()
local p2 = p1
if radius then
end
core.log("action", "Moving " .. player_obj:get_player_name() ..
" to static spawnpoint at " .. core.pos_to_string(static_spawnpoint))
- player_obj:setpos(static_spawnpoint)
+ player_obj:set_pos(static_spawnpoint)
return true
end