mirror of
https://github.com/HybridDog/nether-pack.git
synced 2025-01-12 10:50:24 +01:00
Fix portal player y pos being off by 1 node sometimes
This commit is contained in:
parent
27be1dd740
commit
27bf94c4d0
@ -649,13 +649,19 @@ local function set_portal(t, z,x, y)
|
||||
t[z][x] = y
|
||||
end
|
||||
|
||||
local function get_player_nodepos(player)
|
||||
local pos = player:get_pos()
|
||||
pos.y = pos.y + player:get_properties().collisionbox[2] + 0.5
|
||||
return vector.round(pos)
|
||||
end
|
||||
|
||||
-- used when a player eats that fruit in a portal
|
||||
function nether.teleport_player(player)
|
||||
if not player then
|
||||
minetest.log("error", "[nether] Missing player.")
|
||||
return
|
||||
end
|
||||
local pos = vector.round(player:get_pos())
|
||||
local pos = get_player_nodepos(player)
|
||||
if not is_netherportal(pos) then
|
||||
return
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user