final int maxYSections = this.heightCap / 8 + 1;
final int usedYSections = this.heightScale / 8 + 1;
WorldConfig worldConfig = configProvider.getWorldConfig();
BiomeGenerator biomeGenerator = this.localWorld.getBiomeGenerator();
if (worldConfig.improvedRivers)
this.riverArray = biomeGenerator.getBiomesUnZoomed(this.riverArray, chunkX * 4 - maxSmoothRadius,
chunkZ * 4 - maxSmoothRadius, NOISE_MAX_X + maxSmoothDiameter, NOISE_MAX_Z + maxSmoothDiameter, OutputType.ONLY_RIVERS);
if (biomeGenerator.canGenerateUnZoomed())
{
this.biomeArray = biomeGenerator.getBiomesUnZoomed(this.biomeArray, chunkX * 4 - maxSmoothRadius,
chunkZ * 4 - maxSmoothRadius, NOISE_MAX_X + maxSmoothDiameter, NOISE_MAX_Z + maxSmoothDiameter,
OutputType.DEFAULT_FOR_WORLD);
} else
{
this.biomeArray = biomeGenerator.getBiomes(this.biomeArray, chunkX * CHUNK_X_SIZE, chunkZ * CHUNK_Z_SIZE, CHUNK_X_SIZE,
CHUNK_Z_SIZE, OutputType.DEFAULT_FOR_WORLD);
}
generateTerrainNoise(chunkX * four, 0, chunkZ * four, maxYSections, usedYSections);
// Now that the raw terrain is generated, replace raw biome array with
// fine-tuned one.
if (biomeGenerator.canGenerateUnZoomed())
{
this.biomeArray = biomeGenerator.getBiomes(this.biomeArray, chunkX * CHUNK_X_SIZE, chunkZ * CHUNK_Z_SIZE, CHUNK_X_SIZE,
CHUNK_Z_SIZE, OutputType.DEFAULT_FOR_WORLD);
}
final double oneEight = 0.125D;
final double oneFourth = 0.25D;