1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Spawn level: Add 'get_spawn_level(x, z)' API

Returns a suitable player spawn y co-ordinate for unmodified terrain.
This commit is contained in:
paramat 2018-03-07 03:40:35 +00:00 committed by paramat
parent 473d81f2e2
commit 644d0ab2bb
3 changed files with 34 additions and 0 deletions

View file

@ -3035,6 +3035,15 @@ and `minetest.auth_reload` call the authentication handler.
unattached `group:attached_node` node to fall.
* spread these updates to neighbours and can cause a cascade
of nodes to fall.
* `minetest.get_spawn_level(x, z)`
* Returns a player spawn y co-ordinate for the provided (x, z) co-ordinates,
or `nil` for an unsuitable spawn point.
* For most mapgens a 'suitable spawn point' is one with y between
`water_level` and `water_level + 16`, and in mgv7 well away from rivers,
so `nil` will be returned for many (x, z) co-ordinates.
* The spawn level returned is for a player spawn in unmodified terrain.
* The spawn level is intentionally above terrain level to cope with full-node
biome 'dust' nodes.
### Mod channels
You can find mod channels communication scheme in `docs/mod_channels.png`.