Cuberite Forum
Chunk coords - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Chunk coords (/thread-2999.html)



Chunk coords - psyFi - 08-18-2017

If I have ChunkX and ChunkZ, how do I get their world coords?
Can I multiply them by 16 to get the start of the chunk? And add 16 to get the end of the chunk?


RE: Chunk coords - NiLSPACE - 08-18-2017

Multiplying by 16 should work just fine.


RE: Chunk coords - ShadowCone - 08-19-2017

Assuming chunk 0,0 is from 0,0 to 15,15

Then chunk 1,0 would be from 16,0 to 31,15

And chunk n,m would be at n*16,m*16 to n*16+15,m*16+15

So actually you multiply by 16 to get the begin and add 15 to the begin to get the last one.