/*
* int BigLandSize = 2; //default 0, more - smaller
* int ChanceToIncreaseLand = 6; //default 4
* int MaxDepth = 10;
*/
ConfigProvider configs = world.getConfigs();
WorldConfig worldConfig = configs.getWorldConfig();
LocalBiome[][] NormalBiomeMap = new LocalBiome[worldConfig.GenerationDepth + 1][];
LocalBiome[][] IceBiomeMap = new LocalBiome[worldConfig.GenerationDepth + 1][];
for (int i = 0; i < worldConfig.GenerationDepth + 1; i++)
{
ArrayList<LocalBiome> normalBiomes = new ArrayList<LocalBiome>();
ArrayList<LocalBiome> iceBiomes = new ArrayList<LocalBiome>();
for (LocalBiome biome : configs.getBiomeArray())
{
if (biome == null)
continue;
BiomeConfig biomeConfig = biome.getBiomeConfig();
if (biomeConfig.biomeSize != i)
continue;
if (worldConfig.NormalBiomes.contains(biomeConfig.getName()))
{
for (int t = 0; t < biomeConfig.biomeRarity; t++)
normalBiomes.add(biome);
worldConfig.normalBiomesRarity -= biomeConfig.biomeRarity;
}
if (worldConfig.IceBiomes.contains(biomeConfig.getName()))
{
for (int t = 0; t < biomeConfig.biomeRarity; t++)
iceBiomes.add(biome);
worldConfig.iceBiomesRarity -= biomeConfig.biomeRarity;
}
}
if (!normalBiomes.isEmpty())
NormalBiomeMap[i] = normalBiomes.toArray(new LocalBiome[normalBiomes.size() + worldConfig.normalBiomesRarity]);
else
NormalBiomeMap[i] = new LocalBiome[0];
if (!iceBiomes.isEmpty())
IceBiomeMap[i] = iceBiomes.toArray(new LocalBiome[iceBiomes.size() + worldConfig.iceBiomesRarity]);
else
IceBiomeMap[i] = new LocalBiome[0];
}
Layer MainLayer = new LayerEmpty(1L);
Layer RiverLayer = new LayerEmpty(1L);
boolean riversStarted = false;
for (int depth = 0; depth <= worldConfig.GenerationDepth; depth++)
{
MainLayer = new LayerZoom(2001 + depth, MainLayer);
if (worldConfig.randomRivers && riversStarted)
RiverLayer = new LayerZoom(2001 + depth, RiverLayer);
if (worldConfig.LandSize == depth)
{
MainLayer = new LayerLand(1L, MainLayer, worldConfig.LandRarity);
MainLayer = new LayerZoomFuzzy(2000L, MainLayer);
}
if (depth < (worldConfig.LandSize + worldConfig.LandFuzzy))
MainLayer = new LayerLandRandom(depth, MainLayer);
if (NormalBiomeMap[depth].length != 0 || IceBiomeMap[depth].length != 0)
MainLayer = new LayerBiome(200, MainLayer, NormalBiomeMap[depth], IceBiomeMap[depth]);
if (worldConfig.IceSize == depth)
MainLayer = new LayerIce(depth, MainLayer, worldConfig.IceRarity);
if (worldConfig.riverRarity == depth)
if (worldConfig.randomRivers)
{
RiverLayer = new LayerRiverInit(155, RiverLayer);
riversStarted = true;
} else
MainLayer = new LayerRiverInit(155, MainLayer);
if ((worldConfig.GenerationDepth - worldConfig.riverSize) == depth)
{
if (worldConfig.randomRivers)
RiverLayer = new LayerRiver(5 + depth, RiverLayer);
else
MainLayer = new LayerRiver(5 + depth, MainLayer);
}
LayerBiomeBorder layerBiomeBorder = new LayerBiomeBorder(3000 + depth, world);
boolean haveBorder = false;
for (LocalBiome biome : configs.getBiomeArray())
{
if (biome == null)
continue;
BiomeConfig biomeConfig = biome.getBiomeConfig();