Every chunk that has been modified will be generated, so even if no player is nearby, the world.getChunk(x, y, z) method will return a chunk object (or null if no chunk was generated).
Ok, my sentence was too cryptic, meaning: only chunks which -- at some moment -- are been visited by at least one player are generated. Actually, your observation seems to imply that only chunks which have been modified by a player are generated. In either case, there are chunks which would fall in the range of a mapping tool and which are not generated (at least not yet, at the moment the mapping tool needs them), particularly if the mapping tool extends in the depth direction too.
Quote
Basically the server is able to generate a chunk at any position (independent of the players), we just need a convenient way to do that.We can either:
- change the world.getChunk(x, y, z); method, so it always returns a chunk, even if it's necessary to create a new chunk
- add a new world.createChunk(x, y, z); method which creates a new chunk and returns the newly created chunk
I assumed the world.getChunk(x, y, z); method already works in the way you describe (option 1.).
If this is not set in stone yet, I would speculate that option 2. would allow some better optimisation (if the plug-in is well-thought and the author cares, of course), as it would allow the plug-in algorithm to decide if the chunk is really needed or not (either according to some heuristics or to the plug-in settings) and spare the generation of not indispensable chunks (even at the expense of some duplicate call: getChunk() first and then createChunk() if necessary).
This assuming that chunk generation is a rather expensive procedure.
a cave would be anywhere your position is below the known surface level of that postion and chunk
Which seems to me another way of expressing the same definition I was proposing above...
Hmm... what do you mean exactly? Of course the inside of a cave is filled with air, but everything else (below the surface and behind cave walls) is solid rock
I think @zfoxfire is concerned by the 'airy' appearance of the space between the surface and the cave boundary when you fly in it. But all those in-between block are actually solid, aren't they?