Java Code Examples for org.bukkit.block.Biome#BIRCH_FOREST

The following examples show how to use org.bukkit.block.Biome#BIRCH_FOREST . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TreePopulator.java    From GiantTrees with GNU General Public License v3.0 5 votes vote down vote up
private boolean isAcceptableBiome(final Biome biome) {
  return (biome == Biome.FOREST) || (biome == Biome.BIRCH_FOREST)
         || (biome == Biome.SWAMP) || (biome == Biome.JUNGLE)
         || (biome == Biome.DARK_FOREST) || (biome == Biome.DARK_FOREST_HILLS)
         || (biome == Biome.MOUNTAINS) || (biome == Biome.TAIGA)
         || (biome == Biome.SAVANNA);
}
 
Example 2
Source File: CraftBlock.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public static void initMappings() { // Cauldron - initializer to initMappings() method; called in CraftServer
    //BIOME_MAPPING = new Biome[BiomeGenBase.biomeList.length]; // Cauldron - move up
    //BIOMEBASE_MAPPING = new BiomeGenBase[Biome.values().length]; // Cauldron - move up
    BIOME_MAPPING[BiomeGenBase.swampland.biomeID] = Biome.SWAMPLAND;
    BIOME_MAPPING[BiomeGenBase.forest.biomeID] = Biome.FOREST;
    BIOME_MAPPING[BiomeGenBase.taiga.biomeID] = Biome.TAIGA;
    BIOME_MAPPING[BiomeGenBase.desert.biomeID] = Biome.DESERT;
    BIOME_MAPPING[BiomeGenBase.plains.biomeID] = Biome.PLAINS;
    BIOME_MAPPING[BiomeGenBase.hell.biomeID] = Biome.HELL;
    BIOME_MAPPING[BiomeGenBase.sky.biomeID] = Biome.SKY;
    BIOME_MAPPING[BiomeGenBase.river.biomeID] = Biome.RIVER;
    BIOME_MAPPING[BiomeGenBase.extremeHills.biomeID] = Biome.EXTREME_HILLS;
    BIOME_MAPPING[BiomeGenBase.ocean.biomeID] = Biome.OCEAN;
    BIOME_MAPPING[BiomeGenBase.frozenOcean.biomeID] = Biome.FROZEN_OCEAN;
    BIOME_MAPPING[BiomeGenBase.frozenRiver.biomeID] = Biome.FROZEN_RIVER;
    BIOME_MAPPING[BiomeGenBase.icePlains.biomeID] = Biome.ICE_PLAINS;
    BIOME_MAPPING[BiomeGenBase.iceMountains.biomeID] = Biome.ICE_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.mushroomIsland.biomeID] = Biome.MUSHROOM_ISLAND;
    BIOME_MAPPING[BiomeGenBase.mushroomIslandShore.biomeID] = Biome.MUSHROOM_SHORE;
    BIOME_MAPPING[BiomeGenBase.beach.biomeID] = Biome.BEACH;
    BIOME_MAPPING[BiomeGenBase.desertHills.biomeID] = Biome.DESERT_HILLS;
    BIOME_MAPPING[BiomeGenBase.forestHills.biomeID] = Biome.FOREST_HILLS;
    BIOME_MAPPING[BiomeGenBase.taigaHills.biomeID] = Biome.TAIGA_HILLS;
    BIOME_MAPPING[BiomeGenBase.extremeHillsEdge.biomeID] = Biome.SMALL_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.jungle.biomeID] = Biome.JUNGLE;
    BIOME_MAPPING[BiomeGenBase.jungleHills.biomeID] = Biome.JUNGLE_HILLS;
    BIOME_MAPPING[BiomeGenBase.jungleEdge.biomeID] = Biome.JUNGLE_EDGE;
    BIOME_MAPPING[BiomeGenBase.deepOcean.biomeID] = Biome.DEEP_OCEAN;
    BIOME_MAPPING[BiomeGenBase.stoneBeach.biomeID] = Biome.STONE_BEACH;
    BIOME_MAPPING[BiomeGenBase.coldBeach.biomeID] = Biome.COLD_BEACH;
    BIOME_MAPPING[BiomeGenBase.birchForest.biomeID] = Biome.BIRCH_FOREST;
    BIOME_MAPPING[BiomeGenBase.birchForestHills.biomeID] = Biome.BIRCH_FOREST_HILLS;
    BIOME_MAPPING[BiomeGenBase.roofedForest.biomeID] = Biome.ROOFED_FOREST;
    BIOME_MAPPING[BiomeGenBase.coldTaiga.biomeID] = Biome.COLD_TAIGA;
    BIOME_MAPPING[BiomeGenBase.coldTaigaHills.biomeID] = Biome.COLD_TAIGA_HILLS;
    BIOME_MAPPING[BiomeGenBase.megaTaiga.biomeID] = Biome.MEGA_TAIGA;
    BIOME_MAPPING[BiomeGenBase.megaTaigaHills.biomeID] = Biome.MEGA_TAIGA_HILLS;
    BIOME_MAPPING[BiomeGenBase.extremeHillsPlus.biomeID] = Biome.EXTREME_HILLS_PLUS;
    BIOME_MAPPING[BiomeGenBase.savanna.biomeID] = Biome.SAVANNA;
    BIOME_MAPPING[BiomeGenBase.savannaPlateau.biomeID] = Biome.SAVANNA_PLATEAU;
    BIOME_MAPPING[BiomeGenBase.mesa.biomeID] = Biome.MESA;
    BIOME_MAPPING[BiomeGenBase.mesaPlateau_F.biomeID] = Biome.MESA_PLATEAU_FOREST;
    BIOME_MAPPING[BiomeGenBase.mesaPlateau.biomeID] = Biome.MESA_PLATEAU;

    // Extended Biomes
    BIOME_MAPPING[BiomeGenBase.plains.biomeID + 128] = Biome.SUNFLOWER_PLAINS;
    BIOME_MAPPING[BiomeGenBase.desert.biomeID + 128] = Biome.DESERT_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.forest.biomeID + 128] = Biome.FLOWER_FOREST;
    BIOME_MAPPING[BiomeGenBase.taiga.biomeID + 128] = Biome.TAIGA_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.swampland.biomeID + 128] = Biome.SWAMPLAND_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.icePlains.biomeID + 128] = Biome.ICE_PLAINS_SPIKES;
    BIOME_MAPPING[BiomeGenBase.jungle.biomeID + 128] = Biome.JUNGLE_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.jungleEdge.biomeID + 128] = Biome.JUNGLE_EDGE_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.coldTaiga.biomeID + 128] = Biome.COLD_TAIGA_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.savanna.biomeID + 128] = Biome.SAVANNA_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.savannaPlateau.biomeID + 128] = Biome.SAVANNA_PLATEAU_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.mesa.biomeID + 128] = Biome.MESA_BRYCE;
    BIOME_MAPPING[BiomeGenBase.mesaPlateau_F.biomeID + 128] = Biome.MESA_PLATEAU_FOREST_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.mesaPlateau.biomeID + 128] = Biome.MESA_PLATEAU_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.birchForest.biomeID + 128] = Biome.BIRCH_FOREST_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.birchForestHills.biomeID + 128] = Biome.BIRCH_FOREST_HILLS_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.roofedForest.biomeID + 128] = Biome.ROOFED_FOREST_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.megaTaiga.biomeID + 128] = Biome.MEGA_SPRUCE_TAIGA;
    BIOME_MAPPING[BiomeGenBase.extremeHills.biomeID + 128] = Biome.EXTREME_HILLS_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.extremeHillsPlus.biomeID + 128] = Biome.EXTREME_HILLS_PLUS_MOUNTAINS;
    BIOME_MAPPING[BiomeGenBase.megaTaigaHills.biomeID + 128] = Biome.MEGA_SPRUCE_TAIGA_HILLS;

    /* Sanity check - we should have a record for each record in the BiomeBase.a table */
    /* Helps avoid missed biomes when we upgrade bukkit to new code with new biomes */
    for (int i = 0; i < BIOME_MAPPING.length; i++) {
        if ((BiomeGenBase.getBiome(i) != null) && (BIOME_MAPPING[i] == null)) {
            // Cauldron start - add support for mod biomes
            //throw new IllegalArgumentException("Missing Biome mapping for BiomeBase[" + i + "]");
            String name = BiomeGenBase.getBiome(i).biomeName;
            int id = BiomeGenBase.getBiome(i).biomeID;

            System.out.println("Adding biome mapping " + BiomeGenBase.getBiome(i).biomeID + " " + name + " at BiomeBase[" + i + "]");
            net.minecraftforge.common.util.EnumHelper.addBukkitBiome(name); // Forge
            BIOME_MAPPING[BiomeGenBase.getBiome(i).biomeID] = ((Biome) Enum.valueOf(Biome.class, name));
            // Cauldron end           
        }
        if (BIOME_MAPPING[i] != null) {  /* Build reverse mapping for setBiome */
            BIOMEBASE_MAPPING[BIOME_MAPPING[i].ordinal()] = BiomeGenBase.getBiome(i);
        }
    }
}
 
Example 3
Source File: TreePopulator.java    From GiantTrees with GNU General Public License v3.0 4 votes vote down vote up
private Biome simplifyBiome(final Biome biome) {
  switch (biome) {
    case FOREST:
    case FLOWER_FOREST:
      return Biome.FOREST;
    case BIRCH_FOREST:
    case BIRCH_FOREST_HILLS:
    case TALL_BIRCH_FOREST:
    case TALL_BIRCH_HILLS:
      return Biome.BIRCH_FOREST;
    case SWAMP:
    case SWAMP_HILLS:
      return Biome.SWAMP;
    case JUNGLE:
    case JUNGLE_HILLS:
    case MODIFIED_JUNGLE:
      return Biome.JUNGLE;
    case DARK_FOREST:
    case DARK_FOREST_HILLS:
      return Biome.DARK_FOREST;
    case TAIGA:
    case TAIGA_HILLS:
    case TAIGA_MOUNTAINS:
    case SNOWY_TAIGA_MOUNTAINS:
    case SNOWY_TAIGA:
    case SNOWY_TAIGA_HILLS:
    case GIANT_SPRUCE_TAIGA:
    case GIANT_SPRUCE_TAIGA_HILLS:
    case GIANT_TREE_TAIGA:
    case GIANT_TREE_TAIGA_HILLS:
      return Biome.TAIGA;
    case MOUNTAINS:
    case WOODED_MOUNTAINS:
      return Biome.MOUNTAINS;
    case SAVANNA:
    case SAVANNA_PLATEAU:
    case SHATTERED_SAVANNA:
    case SHATTERED_SAVANNA_PLATEAU:
      return Biome.SAVANNA;
    default:
      return null;
  }
}