Updated Chunks managment (markdown)

TheMode 2020-09-27 21:05:03 +02:00
parent 74fbebb710
commit bf07659ca4

@ -1,7 +1,7 @@
# Steps # Steps
When trying to load a chunk, the instance does multiple checks in this order: When trying to load a chunk, the instance does multiple checks in this order:
1. Verify if the chunk is already loaded (stop here if yes) 1. Verify if the chunk is already loaded (stop here if yes)
2. Try to load the chunk from the instance IChunkLoader using [IChunkLoader#loadChunk](https://github.com/Minestom/Minestom/blob/master/src/main/java/net/minestom/server/instance/IChunkLoader.java#L21) (stop here if the chunk loading is successful) 2. Try to load the chunk from the instance [IChunkLoader](https://github.com/Minestom/Minestom/blob/master/src/main/java/net/minestom/server/instance/IChunkLoader.java) using [IChunkLoader#loadChunk](https://github.com/Minestom/Minestom/blob/master/src/main/java/net/minestom/server/instance/IChunkLoader.java#L21) (stop here if the chunk loading is successful)
3. Create a new chunk and execute the instance ChunkGenerator (if any) to it to generate all of the chunk's blocks 3. Create a new chunk and execute the instance ChunkGenerator (if any) to it to generate all of the chunk's blocks
When trying to save a chunk, [IChunkLoader#saveChunk](https://github.com/Minestom/Minestom/blob/master/src/main/java/net/minestom/server/instance/IChunkLoader.java#L30) is called When trying to save a chunk, [IChunkLoader#saveChunk](https://github.com/Minestom/Minestom/blob/master/src/main/java/net/minestom/server/instance/IChunkLoader.java#L30) is called