    001package net.minecraftforge.common;
    002
    003import java.util.ArrayList;
    004import java.util.Arrays;
    005import java.util.HashSet;
    006import java.util.Set;
    007
    008import net.minecraft.world.biome.BiomeGenBase;
    009import net.minecraft.world.gen.ChunkProviderGenerate;
    010import net.minecraft.world.chunk.IChunkProvider;
    011import net.minecraft.world.gen.structure.MapGenStronghold;
    012import net.minecraft.world.gen.structure.MapGenVillage;
    013import net.minecraft.world.biome.WorldChunkManager;
    014
    015import com.google.common.collect.Lists;
    016
    017public class BiomeManager
    018{
    019    public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
    020    {
    021        if (!MapGenVillage.villageSpawnBiomes.contains(biome))
    022        {
    023            ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
    024            biomes.add(biome);
    025            MapGenVillage.villageSpawnBiomes = biomes;
    026        }
    027    }
    028
    029    public static void removeVillageBiome(BiomeGenBase biome)
    030    {
    031        if (MapGenVillage.villageSpawnBiomes.contains(biome))
    032        {
    033            ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
    034            biomes.remove(biome);
    035            MapGenVillage.villageSpawnBiomes = biomes;
    036        }
    037    }
    038
    039    public static void addStrongholdBiome(BiomeGenBase biome)
    040    {
    041        if (!MapGenStronghold.allowedBiomes.contains(biome))
    042        {
    043            MapGenStronghold.allowedBiomes.add(biome);
    044        }
    045    }
    046
    047    public static void removeStrongholdBiome(BiomeGenBase biome)
    048    {
    049        if (MapGenStronghold.allowedBiomes.contains(biome))
    050        {
    051            MapGenStronghold.allowedBiomes.remove(biome);
    052        }
    053    }
    054
    055    public static void addSpawnBiome(BiomeGenBase biome)
    056    {
    057        if (!WorldChunkManager.allowedBiomes.contains(biome))
    058        {
    059            WorldChunkManager.allowedBiomes.add(biome);
    060        }
    061    }
    062
    063    public static void removeSpawnBiome(BiomeGenBase biome)
    064    {
    065        if (WorldChunkManager.allowedBiomes.contains(biome))
    066        {
    067            WorldChunkManager.allowedBiomes.remove(biome);
    068        }
    069    }
    070}