minetest-mods / nether

Nether mod for Minetest
https://forum.minetest.net/viewtopic.php?f=11&t=5790
19 stars 26 forks source link

portal to nether fails to teleport player, if nether is located above the overworld #41

Closed Bastrabun closed 3 years ago

Bastrabun commented 3 years ago

With these settings, the nether will be located way above the overworld:

nether_depth_ymax = 30500 nether_depth_ymin = 25000

Result is that is_within_realm pos.y is always lower than nether.DEPTH_CEILING on any portal. This leads to the first, igniting portal found as teleport target.

Solution is too small for a proper pull request, so just here:

init.lua 154:

is_within_realm = function(pos) -- return true if pos is inside the Nether
    return pos.y < nether.DEPTH_CEILING
end,

=>

is_within_realm = function(pos) -- return true if pos is inside the Nether
    return (pos.y < nether.DEPTH_CEILING and pos.y > nether.DEPTH_FLOOR)
end,