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();
if (biomeConfig.biomeSize != depth)
continue;
if (worldConfig.IsleBiomes.contains(biomeConfig.getName()) && biomeConfig.isleInBiome != null)
{
int id = biome.getIds().getGenerationId();
LayerBiomeInBiome layerBiome = new LayerBiomeInBiome(4000 + id, MainLayer);
layerBiome.biome = biome;
for (String islandInName : biomeConfig.isleInBiome)
{
int islandIn = world.getBiomeByName(islandInName).getIds().getGenerationId();
if (islandIn == DefaultBiome.OCEAN.Id)
layerBiome.inOcean = true;
else
layerBiome.biomeIsles[islandIn] = true;
}
layerBiome.chance = (worldConfig.BiomeRarityScale + 1) - biomeConfig.biomeRarity;
MainLayer = layerBiome;
}
if (worldConfig.BorderBiomes.contains(biomeConfig.getName()) && biomeConfig.biomeIsBorder != null)
{
haveBorder = true;
for (String replaceFromName : biomeConfig.biomeIsBorder)
{
int replaceFrom = world.getBiomeByName(replaceFromName).getIds().getGenerationId();