2012-10-28 14:38:38 +00:00
|
|
|
package net.minecraftforge.common;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2012-12-13 05:58:35 +00:00
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
|
|
|
import net.minecraft.world.gen.structure.MapGenVillage;
|
|
|
|
import net.minecraft.world.biome.WorldChunkManager;
|
2012-10-28 14:38:38 +00:00
|
|
|
|
|
|
|
public class BiomeManager
|
|
|
|
{
|
2013-12-22 23:47:51 +00:00
|
|
|
public static ArrayList<BiomeGenBase> strongHoldBiomes = new ArrayList<BiomeGenBase>();
|
|
|
|
public static ArrayList<BiomeGenBase> strongHoldBiomesBlackList = new ArrayList<BiomeGenBase>();
|
|
|
|
|
2014-01-18 05:55:48 +00:00
|
|
|
@SuppressWarnings("unchecked")
|
2012-10-28 14:38:38 +00:00
|
|
|
public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
|
|
|
|
{
|
|
|
|
if (!MapGenVillage.villageSpawnBiomes.contains(biome))
|
|
|
|
{
|
|
|
|
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
|
|
|
|
biomes.add(biome);
|
|
|
|
MapGenVillage.villageSpawnBiomes = biomes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-18 05:55:48 +00:00
|
|
|
@SuppressWarnings("unchecked")
|
2012-10-28 14:38:38 +00:00
|
|
|
public static void removeVillageBiome(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
if (MapGenVillage.villageSpawnBiomes.contains(biome))
|
|
|
|
{
|
|
|
|
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
|
|
|
|
biomes.remove(biome);
|
|
|
|
MapGenVillage.villageSpawnBiomes = biomes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void addStrongholdBiome(BiomeGenBase biome)
|
|
|
|
{
|
2013-12-22 23:47:51 +00:00
|
|
|
if (!strongHoldBiomes.contains(biome))
|
2012-10-28 14:38:38 +00:00
|
|
|
{
|
2013-12-22 23:47:51 +00:00
|
|
|
strongHoldBiomes.add(biome);
|
2012-10-28 14:38:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void removeStrongholdBiome(BiomeGenBase biome)
|
|
|
|
{
|
2013-12-22 23:47:51 +00:00
|
|
|
if (!strongHoldBiomesBlackList.contains(biome))
|
2012-10-28 14:38:38 +00:00
|
|
|
{
|
2013-12-22 23:47:51 +00:00
|
|
|
strongHoldBiomesBlackList.add(biome);
|
2012-10-28 14:38:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void addSpawnBiome(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
if (!WorldChunkManager.allowedBiomes.contains(biome))
|
|
|
|
{
|
|
|
|
WorldChunkManager.allowedBiomes.add(biome);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void removeSpawnBiome(BiomeGenBase biome)
|
|
|
|
{
|
|
|
|
if (WorldChunkManager.allowedBiomes.contains(biome))
|
|
|
|
{
|
|
|
|
WorldChunkManager.allowedBiomes.remove(biome);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|