    001    package net.minecraftforge.common;
    002
    003    import java.util.ArrayList;
    004    import java.util.Arrays;
    005    import java.util.HashSet;
    006    import java.util.Set;
    007
    008    import net.minecraft.src.BiomeGenBase;
    009    import net.minecraft.src.ChunkProviderGenerate;
    010    import net.minecraft.src.IChunkProvider;
    011    import net.minecraft.src.MapGenStronghold;
    012    import net.minecraft.src.MapGenVillage;
    013    import net.minecraft.src.WorldChunkManager;
    014
    015    import com.google.common.collect.Lists;
    016
    017    public 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    }