Cuberite Forum
cWorld:GetHeight() API - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: cWorld:GetHeight() API (/thread-1353.html)



cWorld:GetHeight() API - xoft - 02-06-2014

Hi,

after recent experiences with running the server, I'd like to remove the cWorld:GetHeight() function from the exported API. The function makes too much trouble - when a plugin calls it, the function blocks until the chunk is available, but it holds the ChunkMap lock, thus creating a deadlock.

The recommended substitute is cWorld:TryGetHeight(), which returns immediately when the height is not available.

The GetHeight() function has long been marked in the API docs as obsolete, so it's time to finally get rid of it.

Does anyone have any immediate concerns about this change?


RE: cWorld:GetHeight() API - NiLSPACE - 02-08-2014

I tried using TryGetHeight with the WorldEdit plugin but it only returns true, and not the height of the world.


RE: cWorld:GetHeight() API - xoft - 02-08-2014

The return values are swapped, I'll fix that in the source so that it works as documented.