Vector3i minWorldPosForChunk = new Vector3i(ChunkConstants.SIZE_X * chunkCoordinate.x,
ChunkConstants.SIZE_Y * chunkCoordinate.y,
ChunkConstants.SIZE_Z * chunkCoordinate.z);
Region3i chunkWorldRegion = Region3i.createFromMinAndSize(minWorldPosForChunk, ChunkConstants.CHUNK_SIZE);
int hmX = (((chunkWorldRegion.minX() / chunkWorldRegion.sizeX()) % 512) + 512) % 512;
int hmZ = (((chunkWorldRegion.minZ() / chunkWorldRegion.sizeZ()) % 512) + 512) % 512;
double scaleFactor = 0.05 * MAX_HEIGHT;
double p00 = heightmap[hmX][hmZ] * scaleFactor;