下面列出了怎么用net.minecraftforge.common.BiomeDictionary的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
int x = chunkX * 16;
int z = chunkZ * 16;
Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
return;
}
if (random.nextFloat() < 70 / 4000.0F) {
int posX = x + world.rand.nextInt(16) + 8;
int posZ = z + world.rand.nextInt(16) + 8;
BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
if ((newPos != null) && (BlockLoader.SOYBEAN.canPlaceBlockAt(world, newPos))) {
world.setBlockState(newPos, BlockLoader.SOYBEAN.getDefaultState().withProperty(BlockSoybean.AGE, random.nextInt(4)), 2);
}
}
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
int x = chunkX * 16;
int z = chunkZ * 16;
Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
return;
}
if (random.nextFloat() < SakuraConfig.bambooshot_weight / 4000.0F)
{
int posX = x+ world.rand.nextInt(16) + 8;
int posZ = z+ world.rand.nextInt(16) + 8;
BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
if ((newPos != null) && (BlockLoader.BAMBOOSHOOT.canBlockStay(world, newPos))) {
world.setBlockState(newPos, BlockLoader.BAMBOOSHOOT.getDefaultState(), 2);
}
}
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
int x = chunkX * 16;
int z = chunkZ * 16;
Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
return;
}
if (random.nextFloat() < SakuraConfig.pepper_weight / 4000.0F) {
int posX = x + world.rand.nextInt(16) + 8;
int posZ = z + world.rand.nextInt(16) + 8;
BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
if ((newPos != null) && (BlockLoader.PEPPER_SPLINT.canPlaceBlockAt(world, newPos))) {
world.setBlockState(newPos, BlockLoader.PEPPERCROP.getDefaultState(), 2);
}
}
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
int x = chunkX * 16;
int z = chunkZ * 16;
Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
return;
}
if (random.nextFloat() < SakuraConfig.vanilla_weight / 4000.0F)
{
int posX = x + world.rand.nextInt(16) + 8;
int posZ = z + world.rand.nextInt(16) + 8;
BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
if ((newPos != null) && (BlockLoader.VANILLA_SPLINT.canPlaceBlockAt(world, newPos))) {
world.setBlockState(newPos, BlockLoader.VANILLACROP.getDefaultState(), 2);
}
}
}
public static void register(Version versionAdded,
Biome biome,
BiomeType type,
String name,
int weight,
boolean disabled,
boolean canSpawn,
VillageReplacements villageReplacements,
RegistryEvent.Register<Biome> event,
BiomeDictionary.Type... biomeDictTypes) {
if (!disabled) {
biome.setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name));
event.getRegistry().register(biome);
for (BiomeDictionary.Type biomeDictType : biomeDictTypes) {
BiomeDictionary.addTypes(biome, biomeDictType);
}
biomeList.add(new TraverseBiomeEntry(biome, type, weight, canSpawn, !TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES, versionAdded));
if (!TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES && villageReplacements != NO_REPLACEMENTS) {
villageReplacementBiomes.put(biome, villageReplacements);
}
}
}
public static void register(Version versionAdded,
Biome biome,
BiomeType type,
String name,
int weight,
boolean disabled,
boolean canSpawn,
VillageReplacements villageReplacements,
RegistryEvent.Register<Biome> event,
BiomeDictionary.Type... biomeDictTypes) {
if (!disabled) {
biome.setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name));
event.getRegistry().register(biome);
for (BiomeDictionary.Type biomeDictType : biomeDictTypes) {
BiomeDictionary.addTypes(biome, biomeDictType);
}
biomeList.add(new TraverseBiomeEntry(biome, type, weight, canSpawn, !TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES, versionAdded));
if (!TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES && villageReplacements != NO_REPLACEMENTS) {
villageReplacementBiomes.put(biome, villageReplacements);
}
}
}
/**
* Adds all biomes of this type to the list of biomes allowed to generate
* @param type
*/
public void addBiomeType(BiomeDictionary.Type type) {
ArrayList<Biome> entryList = new ArrayList<Biome>();
entryList.addAll(BiomeDictionary.getBiomes(type));
//Neither are acceptable on planets
entryList.remove(Biome.getBiome(8));
entryList.remove(Biome.getBiome(9));
//Make sure we dont add double entries
Iterator<Biome> iter = entryList.iterator();
while(iter.hasNext()) {
Biome nextbiome = iter.next();
for(BiomeEntry entry : allowedBiomes) {
if(BiomeDictionary.areSimilar(entry.biome, nextbiome))
iter.remove();
}
}
allowedBiomes.addAll(getBiomesEntries(entryList));
}
@Override
public void generate (Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
int x = chunkX * 16;
int z = chunkZ * 16;
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.COLD)
|| BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER)
|| BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WET)
|| BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WASTELAND)
|| BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY))
return;
if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY))
return;
if (random.nextInt(10) > 0)
return;
generate(world, random, x, world.getActualHeight() - 1, z);
}
protected boolean isExcluded(Biome candidate) {
for (BiomeDictionary.Type exType : typeExcludes) {
if (BiomeDictionary.hasType(candidate, exType)) {
if (Config.spawnConfigPrintDetailedOutput) {
System.out.print("Excluded " + candidate.getBiomeName() + ", ");
}
return true;
}
}
for (ResourceLocation exName : nameExcludes) {
if (exName != null && exName.equals(candidate.getRegistryName())) {
System.out.print("Excluded " + candidate.getRegistryName() + ", ");
return false;
}
}
return false;
}
@Override
public boolean isMatchingBiome(Biome biome) {
if (isExcluded(biome)) {
return false;
}
if (!names.isEmpty() && !names.contains(biome.getRegistryName())) {
return false;
}
for (BiomeDictionary.Type type : types) {
if (!BiomeDictionary.hasType(biome, type)) {
return false;
}
}
return true;
}
public SettingsMesaTheme(){
this.id = ID;
this.inherit.add(SettingsBase.ID);
this.criteria = new SpawnCriteria();
List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
biomes.add(BiomeDictionary.Type.MESA);
this.criteria.setBiomeTypes(biomes);
this.towerSettings = new TowerSettings(Tower.ETHO, Theme.getTheme(Theme.ETHOTOWER));
Theme[] themes = {Theme.ETHOTOWER, Theme.ETHOTOWER, Theme.CRYPT, Theme.CRYPT, Theme.NETHER};
for(int i = 0; i < 5; ++i){
LevelSettings level = new LevelSettings();
level.setTheme(Theme.getTheme(themes[i]));
levels.put(i, level);
}
}
public static void register(IForgeRegistry<Biome> registry) {
registry.register(BAMBOOFOREST.setRegistryName("bamboo_forest"));
BiomeManager.addBiome(BiomeManager.BiomeType.WARM,new BiomeManager.BiomeEntry(BAMBOOFOREST, 8));
BiomeDictionary.addTypes(BAMBOOFOREST, HOT, WET, DENSE, JUNGLE);
registry.register(MAPLEFOREST.setRegistryName("maple_forest"));
BiomeManager.addBiome(BiomeManager.BiomeType.WARM,new BiomeManager.BiomeEntry(MAPLEFOREST, 8));
BiomeDictionary.addTypes(MAPLEFOREST, FOREST);
}
public static void register(Version versionAdded,
Biome biome,
BiomeType type,
String name,
int weight,
boolean disabled,
boolean canSpawn,
RegistryEvent.Register<Biome> event,
BiomeDictionary.Type... biomeDictTypes) {
register(versionAdded, biome, type, name, weight, disabled, canSpawn, NO_VILLAGES, event, biomeDictTypes);
}
@Override
public void registerEntities(IForgeRegistry<EntityEntry> reg)
{
reg.register(EntityEntryBuilder.create()
.name(CommunityGlobals.MOD_ID + "." + "wood_gnome")
.entity(EntityGnomeWood.class)
.id(new ResourceLocation(CommunityGlobals.MOD_ID, "wood_gnome"), CommunityGlobals.entity_id++)
.tracker(80, 3, false)
.spawn(EnumCreatureType.CREATURE, 10, 1, 4, BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST))
.egg(0xd3753f, 0x774725)
.build());
}
@Override
public void registerEntities(IForgeRegistry<EntityEntry> reg) {
Set<Biome> biomeset = BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST);
Biome[] biomes = biomeset.toArray(new Biome[0]);
reg.register(EntityEntryBuilder.create()
.entity(EntityDabSquirrel.class).egg(0x89806f, 0xb2a489)
.name(CommunityGlobals.MOD_ID + ".dabsquirrel")
.id(new ResourceLocation(CommunityGlobals.MOD_ID, "dabsquirrel"), CommunityGlobals.entity_id++)
.tracker(128, 1, true)
.spawn(EnumCreatureType.CREATURE, 12, 1, 3, biomes)
.build());
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (world.getWorldType() == WorldType.FLAT ||
!world.provider.isSurfaceWorld()) {
return; //do not generate in flat worlds, or in non-surface worlds
}
BlockPos randomPos = new BlockPos(chunkX * 16 + 8, 0, chunkZ * 16 + 8);
Biome biome = world.getBiome(randomPos);
if (BiomeDictionary.hasType(biome, Type.COLD) ||
BiomeDictionary.hasType(biome, Type.HOT) ||
BiomeDictionary.hasType(biome, Type.DRY) ||
BiomeDictionary.hasType(biome, Type.DEAD) ||
BiomeDictionary.hasType(biome, Type.SPOOKY))
return; //do not generate in inappropriate biomes
int rubberTreeChance = 6;
if (BiomeDictionary.hasType(biome, Type.SWAMP) ||
BiomeDictionary.hasType(biome, Type.WET))
rubberTreeChance /= 2; //double chance of spawning in swamp or wet biomes
if (random.nextInt(rubberTreeChance) == 0) {
randomPos = world.getTopSolidOrLiquidBlock(randomPos).down();
IBlockState solidBlockState = world.getBlockState(randomPos);
BlockGregSapling sapling = MetaBlocks.SAPLING;
if (solidBlockState.getBlock().canSustainPlant(solidBlockState, world, randomPos, EnumFacing.UP, sapling)) {
BlockPos abovePos = randomPos.up();
IBlockState saplingState = sapling.getDefaultState()
.withProperty(BlockGregSapling.VARIANT, LogVariant.RUBBER_WOOD);
world.setBlockState(abovePos, saplingState);
sapling.generateTree(world, abovePos, saplingState, random);
}
}
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
Biome biomegenbase = world.getBiome(new BlockPos(chunkX * 16 + 16, 128, chunkZ * 16 + 16));
// Any Biome
GTOreGenerator.generateBasicVein(GTBlocks.oreIridium, GTConfig.generation.iridiumGenerate, GTConfig.generation.iridiumSize, GTConfig.generation.iridiumWeight, 0, 128, Blocks.STONE, world, random, chunkX, chunkZ);
// Jungle Biomes
if (BiomeDictionary.hasType(biomegenbase, Type.JUNGLE)) {
GTOreGenerator.generateBasicVein(GTBlocks.oreSheldonite, GTConfig.generation.sheldoniteGenerate, GTConfig.generation.sheldoniteSize, GTConfig.generation.sheldoniteWeight, 10, 30, Blocks.STONE, world, random, chunkX, chunkZ);
}
// Hot Biomes
if (BiomeDictionary.hasType(biomegenbase, Type.HOT)) {
GTOreGenerator.generateBasicVein(GTBlocks.oreRuby, GTConfig.generation.rubyGenerate, GTConfig.generation.rubySize, GTConfig.generation.rubyWeight, 0, 48, Blocks.STONE, world, random, chunkX, chunkZ);
}
// Ocean Biomes
if (BiomeDictionary.hasType(biomegenbase, Type.OCEAN) || BiomeDictionary.hasType(biomegenbase, Type.BEACH)) {
GTOreGenerator.generateBasicVein(GTBlocks.oreSapphire, GTConfig.generation.sapphireGenerate, GTConfig.generation.sapphireSize, GTConfig.generation.sapphireWeight, 0, 48, Blocks.STONE, world, random, chunkX, chunkZ);
}
// Forest or Plains Biomes
if (BiomeDictionary.hasType(biomegenbase, Type.FOREST)
|| (BiomeDictionary.hasType(biomegenbase, Type.PLAINS))) {
GTOreGenerator.generateBasicVein(GTBlocks.oreBauxite, GTConfig.generation.bauxiteGenerate, GTConfig.generation.bauxiteSize, GTConfig.generation.bauxiteWeight, 50, 120, Blocks.STONE, world, random, chunkX, chunkZ);
}
if (world.provider.getDimensionType().equals(DimensionType.OVERWORLD)) {
for (Block block : GTBedrockOreHandler.getBedrockOreMap().keySet()) {
if (GTBedrockOreHandler.shouldGTCHandleGeneration(block)) {
GTOreGenerator.generateBedrockVein(block, world, random, chunkX, chunkZ);
}
}
}
}
public static void register(Version versionAdded,
Biome biome,
BiomeType type,
String name,
int weight,
boolean disabled,
boolean canSpawn,
RegistryEvent.Register<Biome> event,
BiomeDictionary.Type... biomeDictTypes) {
register(versionAdded, biome, type, name, weight, disabled, canSpawn, NO_VILLAGES, event, biomeDictTypes);
}
@SubscribeEvent
public static void register(RegistryEvent.Register<Biome> evt) {
IForgeRegistry<Biome> r = evt.getRegistry();
r.registerAll(BIOME_UNDERWORLD);
// BiomeDictionary.addTypes(BIOME_TORIKKI, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.WASTELAND);
BiomeDictionary.addTypes(BIOME_UNDERWORLD, BiomeDictionary.Type.VOID, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.DRY, BiomeDictionary.Type.COLD);
// BiomeDictionary.addTypes(BIOME_TORIKKISEA, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.WASTELAND,BiomeDictionary.Type.WATER);
}
public static void addSpawnFromType(final Class<? extends EntityLiving> entityClass,
final int weightedProb, final int min, final int max,
final EnumCreatureType typeOfCreature,
final BiomeDictionary.Type... biomeTypes) {
final ArrayList<Biome> biomes = new ArrayList<Biome>();
for (final BiomeDictionary.Type biomeType : biomeTypes) {
biomes.addAll(BiomeDictionary.getBiomes(biomeType));
}
EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature,
biomes.toArray(new Biome[biomes.size()]));
}
@Override
public boolean isMatchingBiome(Biome biome) {
if (isExcluded(biome)) {
return false;
}
if (names.contains(biome.getRegistryName())) {
return true;
}
for (BiomeDictionary.Type type : types) {
if (BiomeDictionary.hasType(biome, type)) {
return true;
}
}
return false;
}
@Override
public boolean includesBiomeType(List<Type> biomeTypes) {
for(BiomeDictionary.Type type : biomeTypes){
if(biomeHasType(type)) return true;
}
return false;
}
public SettingsIceTheme(){
this.id = ID;
this.inherit.add(SettingsBase.ID);
this.criteria = new SpawnCriteria();
List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
biomes.add(BiomeDictionary.Type.SNOWY);
this.criteria.setBiomeTypes(biomes);
this.towerSettings = new TowerSettings(Tower.PYRAMID, Theme.getTheme(Theme.ICE));
}
@Override
public void execute(ICommandContext context, List<String> args) {
ArgumentParser ap = new ArgumentParser(args);
IWorldEditor editor = context.createEditor();
Coord pos;
if(!ap.hasEntry(0)){
pos = context.getPos();
} else {
int x; int z;
try {
x = CommandBase.parseInt(ap.get(0));
z = CommandBase.parseInt(ap.get(1));
} catch (NumberInvalidException e) {
context.sendMessage("Failure: Invalid Coords: X Z", MessageType.ERROR);
return;
}
pos = new Coord(x, 0, z);
}
context.sendMessage("Biome Information for " + pos.toString(), MessageType.SPECIAL);
Biome biome = editor.getInfo(pos).getBiome();
context.sendMessage(biome.getBiomeName(), MessageType.SPECIAL);
Set<BiomeDictionary.Type> biomeTypes = BiomeDictionary.getTypes(biome);
String types = "";
for(BiomeDictionary.Type type : biomeTypes){
types += type.getName() + " ";
}
context.sendMessage(types, MessageType.SPECIAL);
return;
}
public static BiomeDictionary.Type getBiomeTypeTagByName(String name) {
Map<String, BiomeDictionary.Type> byName = ReflectionHelper.getPrivateValue(BiomeDictionary.Type.class, null, "byName");
return byName.get(name);
}
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onEvent(PopulateChunkEvent.Post event) {
if (!event.getWorld().provider.getDimensionType().equals(DimensionType.OVERWORLD)) {
return;
}
if (GTConfig.general.replaceOceanGravelWithSand) {
Chunk chunk = event.getWorld().getChunkFromChunkCoords(event.getChunkX(), event.getChunkZ());
for (int x = 0; x < 16; ++x) {
for (int z = 0; z < 16; ++z) {
Biome biomegenbase = event.getWorld().getBiome(new BlockPos(chunk.x * 16 + x, 128, chunk.z * 16
+ z));
if (BiomeDictionary.hasType(biomegenbase, Type.OCEAN)
|| BiomeDictionary.hasType(biomegenbase, Type.BEACH)) {
for (int y = 30; y < 60; ++y) {
if (chunk.getBlockState(x, y, z).getBlock() == BLOCK_GRAVEL) {
chunk.setBlockState(new BlockPos(x, y, z), BLOCK_SAND.getDefaultState());
}
}
}
}
}
chunk.markDirty();
}
// if (GTConfig.general.redSandInForestsAndPlains) {
// Chunk chunk = event.getWorld().getChunkFromChunkCoords(event.getChunkX(), event.getChunkZ());
// for (int x = 0; x < 16; ++x) {
// for (int z = 0; z < 16; ++z) {
// Biome biomegenbase = event.getWorld().getBiome(new BlockPos(chunk.x * 16 + x, 128, chunk.z * 16
// + z));
// if (BiomeDictionary.hasType(biomegenbase, Type.FOREST)
// || BiomeDictionary.hasType(biomegenbase, Type.PLAINS)) {
// for (int y = 30; y < 80; ++y) {
// if (chunk.getBlockState(x, y, z).getBlock() == BLOCK_SAND) {
// chunk.setBlockState(new BlockPos(x, y, z), BLOCKSTATE_RED_SAND);
// }
// }
// }
// }
// }
// chunk.markDirty();
// }
}
private boolean canGen(World world, Random rand, int x, int z) {
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
return BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) && BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY) && rand.nextDouble() <= 0.03D;
}
private boolean canGen(World world, Random rand, int x, int z) {
return BiomeDictionary.isBiomeOfType(world.getBiomeGenForCoords(x, z), BiomeDictionary.Type.MOUNTAIN) && rand.nextDouble() <= 0.3D;
}
protected void registerWorldGen()
{
//GameRegistry.registerWorldGenerator(new WorldGenCliffNoise(), 1);
//GameRegistry.registerWorldGenerator(new WorldGenCliffRocks(), 1);
//GameRegistry.registerWorldGenerator(new WorldGenPortals(), 2);
GameRegistry.registerWorldGenerator(new WorldGenStalag(), 4);
HexGenRegistry.registerWorldGenerator(new WorldGenCliffRocksHex(), 1);
HexGenRegistry.registerWorldGenerator(new WorldGenPortalsHex(), 2);
HexGenRegistry.registerWorldGenerator(new WorldGenClayHex(), 5);
HexGenRegistry.registerWorldGenerator(new WorldGenLooseRockHex(), 5);
HexGenRegistry.registerWorldGenerator(new WorldGenTreesHex(), 10);
HexGenRegistry.registerWorldGenerator(new WorldGenSwampTreesHex(), 10);
HexGenRegistry.registerWorldGenerator(new WorldGenCatTailsHex(), 100);
HexGenRegistry.registerWorldGenerator(new WorldGenGrassHex(), 100);
HexGenRegistry.registerWorldGenerator(new WorldGenGrassDryHex(), 100);
HexGenRegistry.registerWorldGenerator(new WorldGenPamsGardensHex(), 25);
Biome.registerBiome(200, "BIOME_BARE", Global.BIOME_BARE);
Biome.registerBiome(201, "BIOME_BEACH", Global.BIOME_BEACH);
Biome.registerBiome(202, "BIOME_DECIDUOUS_FOREST", Global.BIOME_DECIDUOUS_FOREST);
Biome.registerBiome(203, "BIOME_DEEP_OCEAN", Global.BIOME_DEEP_OCEAN);
Biome.registerBiome(204, "BIOME_DRY_FOREST", Global.BIOME_DRY_FOREST);
Biome.registerBiome(205, "BIOME_GRASSLAND", Global.BIOME_GRASSLAND);
Biome.registerBiome(206, "BIOME_LAKE", Global.BIOME_LAKE);
Biome.registerBiome(207, "BIOME_MARSH", Global.BIOME_MARSH);
Biome.registerBiome(208, "BIOME_OCEAN", Global.BIOME_OCEAN);
Biome.registerBiome(209, "BIOME_POLAR_DESERT", Global.BIOME_POLAR_DESERT);
Biome.registerBiome(210, "BIOME_POND", Global.BIOME_POND);
Biome.registerBiome(211, "BIOME_RAIN_FOREST", Global.BIOME_RAIN_FOREST);
Biome.registerBiome(212, "BIOME_RIVER", Global.BIOME_RIVER);
Biome.registerBiome(213, "BIOME_SCORCHED", Global.BIOME_SCORCHED);
Biome.registerBiome(214, "BIOME_SHRUBLAND", Global.BIOME_SHRUBLAND);
Biome.registerBiome(215, "BIOME_SUBTROPICAL_DESERT", Global.BIOME_SUBTROPICAL_DESERT);
Biome.registerBiome(216, "BIOME_TAIGA", Global.BIOME_TAIGA);
Biome.registerBiome(217, "BIOME_TEMPERATE_DESERT", Global.BIOME_TEMPERATE_DESERT);
Biome.registerBiome(218, "BIOME_TROPICAL_DESERT", Global.BIOME_TROPICAL_DESERT);
Biome.registerBiome(219, "BIOME_TUNDRA", Global.BIOME_TUNDRA);
Biome.registerBiome(220, "BIOME_SWAMP", Global.BIOME_SWAMP);
BiomeDictionary.addTypes(Global.BIOME_BARE, Type.SPARSE, Type.DEAD, Type.WASTELAND);
BiomeDictionary.addTypes(Global.BIOME_BEACH, Type.BEACH);
BiomeDictionary.addTypes(Global.BIOME_DECIDUOUS_FOREST, Type.FOREST);
BiomeDictionary.addTypes(Global.BIOME_DEEP_OCEAN, Type.OCEAN);
BiomeDictionary.addTypes(Global.BIOME_DRY_FOREST, Type.DRY, Type.FOREST);
BiomeDictionary.addTypes(Global.BIOME_GRASSLAND, Type.PLAINS);
BiomeDictionary.addTypes(Global.BIOME_LAKE, Type.WATER);
BiomeDictionary.addTypes(Global.BIOME_MARSH, Type.WET, Type.LUSH, Type.SWAMP);
BiomeDictionary.addTypes(Global.BIOME_OCEAN, Type.OCEAN);
BiomeDictionary.addTypes(Global.BIOME_POLAR_DESERT, Type.COLD, Type.SPARSE, Type.DRY, Type.SANDY, Type.SNOWY);
BiomeDictionary.addTypes(Global.BIOME_POND, Type.WATER);
BiomeDictionary.addTypes(Global.BIOME_RAIN_FOREST, Type.HOT, Type.DENSE, Type.WET, Type.JUNGLE, Type.LUSH, Type.FOREST);
BiomeDictionary.addTypes(Global.BIOME_RIVER, Type.RIVER);
BiomeDictionary.addTypes(Global.BIOME_SCORCHED, Type.HOT, Type.SPARSE, Type.DRY, Type.DEAD, Type.WASTELAND);
BiomeDictionary.addTypes(Global.BIOME_SHRUBLAND, Type.DRY, Type.PLAINS);
BiomeDictionary.addTypes(Global.BIOME_SUBTROPICAL_DESERT, Type.HOT, Type.SPARSE, Type.DRY, Type.SANDY);
BiomeDictionary.addTypes(Global.BIOME_TAIGA, Type.COLD, Type.CONIFEROUS, Type.FOREST, Type.SNOWY);
BiomeDictionary.addTypes(Global.BIOME_TEMPERATE_DESERT, Type.SPARSE, Type.DRY, Type.SANDY);
BiomeDictionary.addTypes(Global.BIOME_TROPICAL_DESERT, Type.HOT, Type.SPARSE, Type.DRY, Type.SANDY);
BiomeDictionary.addTypes(Global.BIOME_TUNDRA, Type.COLD, Type.SPARSE, Type.SNOWY);
BiomeDictionary.addTypes(Global.BIOME_SWAMP, Type.WET, Type.SPOOKY, Type.LUSH, Type.SWAMP);
}
@Override
public void registerEntitySpawns() {
EntityHelper.addSpawnAllBiomes(EntityFluidCow.class, 8, 4, 4, EnumCreatureType.CREATURE);
if (ConfigurationData.EVENT_ENTITIES_ENABLED_VALUE) {
/* Checks if the current date is between the dates (16/12) and (28/12) every year */
if (DateHelper.isDateBetweenBoundaries(16, Month.DECEMBER.getValue(),
28, Month.DECEMBER.getValue())) {
EntityHelper.addSpawnFromType(EntityChristmasCow.class, 8, 4, 4, EnumCreatureType.CREATURE,
BiomeDictionary.Type.SNOWY,
BiomeDictionary.Type.COLD,
BiomeDictionary.Type.FOREST,
BiomeDictionary.Type.PLAINS);
}
/* Checks if the current date is between the dates (10/04) and (24/04) every year */
if (DateHelper.isDateBetweenBoundaries(10, Month.APRIL.getValue(),
24, Month.APRIL.getValue())) {
EntityHelper.addSpawnFromType(EntityEasterCow.class, 8, 4, 4, EnumCreatureType.CREATURE,
BiomeDictionary.Type.HILLS,
BiomeDictionary.Type.FOREST,
BiomeDictionary.Type.PLAINS);
}
/* Checks if the current date is between the dates (26/10) and (1/11) every year */
if (DateHelper.isDateBetweenBoundaries(26, Month.OCTOBER.getValue(),
1, Month.NOVEMBER.getValue())) {
EntityHelper.addSpawnFromType(EntityHalloweenCow.class, 8, 4, 4, EnumCreatureType.CREATURE,
BiomeDictionary.Type.SPOOKY,
BiomeDictionary.Type.DEAD,
BiomeDictionary.Type.FOREST,
BiomeDictionary.Type.PLAINS);
}
/* Checks if the current date is between the dates (29/12) and (04/01) every year */
if (DateHelper.isDateBetweenBoundaries(29, Month.DECEMBER.getValue(),
4, Month.JANUARY.getValue())) {
EntityHelper.addSpawnFromType(EntityNewYearsCow.class, 8, 4, 4, EnumCreatureType.CREATURE,
BiomeDictionary.Type.LUSH,
BiomeDictionary.Type.MAGICAL,
BiomeDictionary.Type.FOREST,
BiomeDictionary.Type.PLAINS);
}
/* Checks if the current date is between the dates (10/02) and (16/02) every year */
if (DateHelper.isDateBetweenBoundaries(10, Month.FEBRUARY.getValue(),
16, Month.FEBRUARY.getValue())) {
EntityHelper.addSpawnFromType(EntityValentinesCow.class, 8, 4, 4, EnumCreatureType.CREATURE,
BiomeDictionary.Type.HOT,
BiomeDictionary.Type.FOREST,
BiomeDictionary.Type.PLAINS);
}
}
}