[SOLVED] Where do I get a reference to a chunk's location from GeneratorPopulator?

I’m attempting to make a plugin that reworks the terrain according to geologic principles, and as such things like ‘base’ terrain, caves, mountains etc; are based on a set of Taylor series approximations that are location dependent. However, in the documentation it doesnt seem like custom GeneratorPopulators have any method or field that gives the chunk coordinates currently being modified by the populator. How do I get these coordinates?

1 Like

The generator operates on buffers, the goal being to make it independent of the generation unit used by the implementation. That is, Minecraft generates at minimum 16x256x16 blocks, but some mod could make it 256x256x256 instead. The generator should simply operate on the buffer, regardless of what is given. If you need the buffer’s block location, use getMin(). If you need that as chunk coordinates, game.getServer().getChunkLayout().toChunk(int, int, int) can do that for you.


Ah ok thanks! For some reason my eyes didn’t catch that in the API.