Java 类net.minecraftforge.common.BiomeDictionary 实例源码

项目:Coding    文件:ModBiomes.java   
public static void preInit() {
    int biomeID = 10;
    while (BiomeDictionary.isBiomeRegistered(biomeID))
        biomeID++;

    // Create Town Forest
    biomeTownForest = new BiomeTownForest(biomeID).setBiomeName(BiomeTownForest.name);
       // Allow villages in this biome
    BiomeManager.addVillageBiome(biomeTownForest, true);
    BiomeDictionary.registerBiomeType(biomeTownForest, Type.MAGICAL);
    int weight = Configs.VILLAGE.town_weight;
    LogHelper.info("ModBiomes: Town Forest created with weight: " + weight);
    biomeEntryTownForest = new BiomeEntry(biomeTownForest, weight);
    BiomeManager.addBiome(BiomeType.WARM, biomeEntryTownForest);

    // Create City Forest
    biomeID++;
    biomeCityPlains = new BiomeCityPlains(biomeID).setBiomeName(BiomeCityPlains.name);
       // Allow villages in this biome
    BiomeManager.addVillageBiome(biomeCityPlains, true);
    BiomeDictionary.registerBiomeType(biomeCityPlains, Type.MAGICAL);
    weight = Configs.VILLAGE.city_weight;
    LogHelper.info("ModBiomes: City Plains created with weight: " + weight);
    biomeEntryCityPlains = new BiomeEntry(biomeCityPlains, weight);
    BiomeManager.addBiome(BiomeType.WARM, biomeEntryCityPlains);
}
项目:SimplyTea    文件:SimplyTea.java   
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
        IChunkProvider chunkProvider) {
    if (random.nextInt(20) == 0){
        int x = chunkX * 16 + 2 + random.nextInt(12);
        int z = chunkZ * 16 + 2 + random.nextInt(12);
        BlockPos p = new BlockPos(x,0,z);
        p = world.getHeight(p);
        Biome b = world.getBiome(p);
        if (BiomeDictionary.hasType(b, BiomeDictionary.Type.FOREST) || b == Biomes.FOREST || b == Biomes.FOREST_HILLS){
            if (world.getBlockState(p.down()).getBlock() instanceof BlockGrass && world.isAirBlock(p)){
                BlockTeaSapling.generateTree(world, p, Blocks.AIR.getDefaultState(), random);
            }
        }
    }
}
项目:Infernum    文件:InfernumEntities.java   
public static void init() {
    int id = 0;
    EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":withering_bolt"), EntityWitheringBolt.class, "withering_bolt", id++, Infernum.instance, 64, 1, true);
    EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), EntityPigZombieMage.class, "zombie_pigman_mage", id++, Infernum.instance, 64, 1, true);
    EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), 14581128, 11799808);
    EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":pigman_mage"), EntityPigMage.class, "pigman_mage", id++, Infernum.instance, 64, 1, true);
    EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":pigman_mage"), 14581128, 11665527);
    EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":fire_breath"), EntityFireBreath.class, "fire_breath", id++, Infernum.instance, 64, 1, true);

    List<Biome> spawnBiomes = new ArrayList<Biome>();
    spawnBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
    spawnBiomes.add(Biomes.HELL);
    for (Biome b : spawnBiomes) {
        System.out.println(b.getBiomeName());
    }
    EntityRegistry.addSpawn(EntityPigZombieMage.class, 150, 1, 2, EnumCreatureType.MONSTER, spawnBiomes.toArray(new Biome[spawnBiomes.size()]));
}
项目:BetterThanWeagles    文件:ModEntities.java   
public static void init()
{
    // Register mod entities
    int entityId = 1;
    EntityRegistry.registerModEntity(new ResourceLocation("btweagles:stevebeej"), EntitySteveBeej.class, "SteveBeej", entityId++, BetterThanWeagles.instance, 64, 3, true, 0xD1A288, 0x00CCCC);

    // Set up spawn criteria
    Set<Biome> validBiomes = new HashSet<>();

    validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS));
    validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST));
    validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.HILLS));
    validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP));

    validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
    validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.END));

    EntityRegistry.addSpawn(EntitySteveBeej.class, 10, 1, 1, EnumCreatureType.MONSTER, validBiomes.toArray(new Biome[validBiomes.size()]));

    // Register entity loot tables
    LootTableList.register(EntitySteveBeej.LOOT_TABLE);
}
项目:ArcaneMagic    文件:Anima.java   
public static Anima getFromBiome(Biome biome)
{
    if (BiomeDictionary.hasType(biome, Type.WATER))
        return Anima.DEPTH;
    else if (BiomeDictionary.hasType(biome, Type.FOREST) || BiomeDictionary.hasType(biome, Type.PLAINS))
        return Anima.HORIZON;
    else if (BiomeDictionary.hasType(biome, Type.DRY) || BiomeDictionary.hasType(biome, Type.NETHER)
            || BiomeDictionary.hasType(biome, Type.HOT))
        return Anima.INFERNO;
    else if (BiomeDictionary.hasType(biome, Type.HILLS) || BiomeDictionary.hasType(biome, Type.MOUNTAIN)
            || BiomeDictionary.hasType(biome, Type.COLD))
        return Anima.OZONE;
    else if (BiomeDictionary.hasType(biome, Type.MESA))
        return Anima.CHAOS;
    else if (biome.equals(Biomes.MUSHROOM_ISLAND) || biome.equals(Biomes.MUSHROOM_ISLAND_SHORE))
        return Anima.PEACE;
    else
        return Anima.HORIZON;
}
项目:GardenStuff    文件:WorldGenCandelilla.java   
@Override
public void generate (Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
    int x = chunkX * 16 + 8;
    int z = chunkZ * 16 + 8;

    Biome biome = world.getBiome(new BlockPos(x, 0, z));
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD ))
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.WET)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.WASTELAND)
        || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SNOWY))
        return;

    if (!BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY))
        return;

    if (random.nextInt(15) > 0)
        return;

    generate(world, random, new BlockPos(x, world.getSeaLevel(), z));
}
项目:TRAPPIST-1    文件:BiomeGenSpace.java   
public BiomeGenSpace(int var1)
{
    super(var1);
    this.topBlock = Blocks.grass;
    this.fillerBlock = Blocks.dirt;
    this.stoneBlock = Blocks.stone;
    this.spawnableCaveCreatureList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableMonsterList.clear();
    this.spawnableWaterCreatureList.clear();

    if (!ConfigManagerCore.disableBiomeTypeRegistrations)
    {
            BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.COLD, BiomeDictionary.Type.DRY, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.SPOOKY);
    }
}
项目:ExPetrum    文件:ExPBiomeDecorator.java   
public void oilPassGenerate(World worldIn, Random rand, Biome biome, BlockPos pos)
{
    float chance = BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY) ? 0.03125F : 0.015625F;
    if (rand.nextFloat() < chance)
    {
        int x = rand.nextInt(16) + 8;
        int z = rand.nextInt(16) + 8;
        BlockPos at = new BlockPos(x, 0, z);
        EventGenOil event = new EventGenOil(worldIn, at, rand, genOil);
        if (MinecraftForge.TERRAIN_GEN_BUS.post(event))
        {
            return;
        }

        event.generator.generate(worldIn, rand, pos.add(at));
    }
}
项目:ExPetrum    文件:ExPBiomeDecorator.java   
public void coralPassGenerate(World worldIn, Random rand, Biome biome, BlockPos pos)
{
    if (!BiomeDictionary.areSimilar(biome, Biomes.OCEAN))
    {
        return;
    }

    int x = rand.nextInt(16) + 8;
    int z = rand.nextInt(16) + 8;
    BlockPos at = worldIn.getHeight(pos.add(x, 0, z));
    EventGenCoral event = new EventGenCoral(worldIn, at, rand, genCoral);
    if (MinecraftForge.TERRAIN_GEN_BUS.post(event))
    {
        return;
    }

    event.generator.generate(worldIn, rand, at);
}
项目:CrystalMod    文件:CrystalTreeFeature.java   
public static boolean generateCrystalTree(final World world, final Random random, final int chunkX, final int chunkZ) {
    final int x = chunkX * 16 + random.nextInt(16);
    final int z = chunkZ * 16 + random.nextInt(16);
    final BlockPos bp = world.getHeight(new BlockPos(x, 0, z));
    Biome biome = world.getBiome(bp);
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.FOREST) || biome instanceof BiomeForest) {
        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, bp, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
        {
            WoodType type = WoodType.BLUE;
            try{
                type = WoodType.byMetadata(MathHelper.getInt(random, 0, WoodType.values().length-1));
            } catch(Exception e){}
            int size = MathHelper.getInt(random, 4, 6);
            final boolean t = new WorldGenCrystalTree(false, size, type, random.nextInt(2) == 0).generate(world, random, bp);
            return t;
        }
    }
    return false;
}
项目:Geographicraft    文件:MountainFormer.java   
public int modifiedIncidence(Numbered<Biome> biomeIncidence) {
    Biome biome = biomeIncidence.item();
    // increase mountains;
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MOUNTAIN)) {
        // multiply by 4
        return biomeIncidence.count()*4;
    }
    // check that extreme hills are a mountain biome
    if (biomeIncidence.item() == Biomes.EXTREME_HILLS) {
        return biomeIncidence.count()*4;
    }
    // Hills unaffected
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.HILLS)) {
        // multiply by 4
        return biomeIncidence.count();
    }
    // Oceans unaffected
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.OCEAN)) {
        // multiply by 4
        return biomeIncidence.count();
    }
    // everything else suppressed;
    return 0;
}
项目:Geographicraft    文件:MountainFormer.java   
public int modifiedIncidence(Numbered<Biome> biomeIncidence) {
    Biome biome = biomeIncidence.item();
    // erase mountains;
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MOUNTAIN)) {
         return 0;
    }
    // check that extreme hills are a mountain biome
    if (biomeIncidence.item() == Biomes.EXTREME_HILLS) {
        return 0;
    }
    // Hills unaffected
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.HILLS)) {
        return biomeIncidence.count();
    }
    // Oceans unaffected
    if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.OCEAN)) {
        return biomeIncidence.count();
    }
    // everything else increased slightly;
    return (biomeIncidence.count()*4)/3;
}
项目:Gravestone-mod-Extended    文件:EntityBoneFishHook.java   
protected List<ItemStack> getToxicWaterCatch(Set<BiomeDictionary.Type> biomeTypesList) {
    List<ItemStack> tempList = new ArrayList<>();
    int chance = this.rand.nextInt(100) + Math.round(luck);

    if (chance < 50) {
        tempList.add(new ItemStack(Items.BONE));
        tempList.add(new ItemStack(Items.ROTTEN_FLESH));
        tempList.add(new ItemStack(Items.SPIDER_EYE));
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.GREEN_JELLYFISH.ordinal()));
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.BONE_FISH.ordinal()));
    } else if (chance < 80) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SPOOKYFIN.ordinal()));
    } else if (chance < 95) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.CURSED_KOI.ordinal()));
    } else {
        if (chance < 98) {
            tempList.add(new ItemStack(Blocks.SKULL, 1, 0)); // SKELETON
            tempList.add(new ItemStack(Blocks.SKULL, 1, 2)); // ZOMBIE
        } else {
            EnchantmentHelper.addRandomEnchantment(rand, new ItemStack(GSItem.ENCHANTED_SKULL, 1, 0), new RandomValueRange(30, 40).generateInt(rand), true);
        }
    }
    return tempList;
}
项目:Gravestone-mod-Extended    文件:EntityCustomFishHook.java   
protected void tier2(List<ItemStack> tempList, Set<BiomeDictionary.Type> biomeTypesList) {
    if (biomeTypesList.contains(BiomeDictionary.Type.OCEAN) || biomeTypesList.contains(BiomeDictionary.Type.BEACH)) {
        tempList.add(new ItemStack(Items.FISH, 1, 3)); //puffer
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.END)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.PEARL_BASS.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SANDY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SANDY_BASS.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SNOWY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SNOWY_CRUCIAN.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SWAMP)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.RUFFE.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.JUNGLE)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.PIRANHA.ordinal()));
    }
    if (tempList.isEmpty()) {
        tempList.add(new ItemStack(Items.FISH, 1, 1)); //salmon
    }
}
项目:Gravestone-mod-Extended    文件:EntityCustomFishHook.java   
protected void tier3(List<ItemStack> tempList, Set<BiomeDictionary.Type> biomeTypesList) {
    if (biomeTypesList.contains(BiomeDictionary.Type.OCEAN) || biomeTypesList.contains(BiomeDictionary.Type.BEACH)) {
        tempList.add(new ItemStack(Items.FISH, 1, 2)); // clown
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.END)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.CHORUS_KOI.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SANDY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.GOLDEN_KOI.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SNOWY)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.FROST_MINNOW.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.SWAMP)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.MUD_TUNA.ordinal()));
    }
    if (biomeTypesList.contains(BiomeDictionary.Type.JUNGLE)) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.SPARKLING_EEL.ordinal()));
    }
    if (tempList.isEmpty()) {
        tempList.add(new ItemStack(GSItem.FISH, 1, ItemFish.EnumFishType.EXPLOSIVE_CRUCIAN.ordinal()));
    }
}
项目:Gravestone-mod-Extended    文件:EntityZombieCat.java   
@Override
@Nullable
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) {
    livingdata = super.onInitialSpawn(difficulty, livingdata);

    Biome biome = this.getEntityWorld().getBiome(new BlockPos(this));
    if ((BiomeDictionary.hasType(biome, BiomeDictionary.Type.DRY) ||
            BiomeDictionary.hasType(biome, BiomeDictionary.Type.SAVANNA)) &&
            this.getRNG().nextInt(5) > 0) {
        this.setMobType(EnumUndeadMobType.HUSK);
    }

    this.setSkin(new Random().nextInt(CAT_TYPES));

    return livingdata;
}
项目:GenLoader    文件:GL_WorldGenerator.java   
private boolean isBiomeValid(World world, int chunkX, int chunkZ, ArrayList<Type> biomeTypes, ArrayList<Integer> biomeIDs)
{
    if (biomeTypes != null)
    {
        for (Type type : BiomeDictionary.getTypesForBiome(world.getBiomeGenForCoords(new BlockPos(chunkX * 16, 0, chunkZ * 16))))
        {
            if (biomeTypes.contains(type))
            {
                return true;
            }
        }
    }
    if (biomeIDs != null)
    {
        BiomeGenBase biome = world.getBiomeGenForCoords(new BlockPos(chunkX * 16, 0, chunkZ * 16));
        if (biomeIDs.contains(biome.biomeID))
        {
            return true;
        }
    }
    return false;
}
项目:ARKCraft    文件:SurfaceResourceGenerator.java   
@Override
public boolean isValidPosition(World world, BlockPos pos)
{
    IBlockState self = world.getBlockState(pos);
    IBlockState down = world.getBlockState(pos.down());
    boolean in = world.getWorldType() != WorldType.FLAT && !BiomeDictionary.isBiomeOfType(world
            .getBiomeForCoordsBody(pos), BiomeDictionary.Type.WATER) && !world.getBlockState(pos.down()).getBlock()
            .isLeaves(down, world, pos.down()) && !(down.getBlock() instanceof BlockARKResource) && self
            .getBlock() != Blocks.WATER && self.getBlock() != Blocks.LAVA;
    if (!in) return in;
    for (int x = -maxWidth / 2; x < maxWidth / 2; x++)
        for (int z = -maxWidth / 2; z < maxWidth / 2; z++)
        {
            in = !(world.getBlockState(pos.add(x, 0, z)).getBlock() instanceof BlockARKResource || world
                    .getBlockState(pos.add(x, 0, z)).getBlock() instanceof BlockSmallRockResource);
            if (!in) return in;
        }

    return in;
}
项目:Factorization    文件:CopperGeyserGen.java   
public static float getModifierForBiome(BiomeGenBase biome) {
    int points = 0;
    for (BiomeDictionary.Type type : BiomeDictionary.getTypesForBiome(biome)) {
        // It's not safe to do a switch on BiomeDictionary.Type; I've gotten a crash caused by weirdos modifying the enum.
        if (type == BiomeDictionary.Type.OCEAN
                || type == BiomeDictionary.Type.RIVER
                || type == BiomeDictionary.Type.WATER
                || type == BiomeDictionary.Type.NETHER
                || type == BiomeDictionary.Type.END) {
            return 0;
        }
        if (type == BiomeDictionary.Type.HOT) points++;
        if (type == BiomeDictionary.Type.JUNGLE) points -= 2;
        if (type == BiomeDictionary.Type.MAGICAL) points--;
        if (type == BiomeDictionary.Type.WASTELAND) points++;
        if (type == BiomeDictionary.Type.MOUNTAIN) points++;
        if (type == BiomeDictionary.Type.HILLS) points++;
        if (type == BiomeDictionary.Type.DEAD) points++;
        if (type == BiomeDictionary.Type.MESA) points += 3;
        if (type == BiomeDictionary.Type.SANDY) points++;
        if (type == BiomeDictionary.Type.SNOWY) points++;
        if (type == BiomeDictionary.Type.MUSHROOM) points--;
        if (type == BiomeDictionary.Type.CONIFEROUS) points++;
    }
    return 1 + biome_suitability_modifier * points;
}
项目:Structures    文件:BiomeFilterAll.java   
@Override
public boolean isMatchingBiome(BiomeGenBase biome) {

  if(isExcluded(biome)) {
    return false;
  }
  if(!names.isEmpty() && !names.contains(biome.biomeName)) {
    return false;
  }
  for(BiomeDictionary.Type type : types) {
    if(!BiomeDictionary.isBiomeOfType(biome, type)) {
      return false;
    }
  }   
  return true; 
}
项目:HarderStart    文件:HS_WorldGenHandler.java   
/**
 * returns different spawn rates for different biomes TODO find a cleaner
 * method of implementation, poor case-by-case
 * 
 * @param biome
 * @return
 */
public int biomeMultiplyer(BiomeGenBase biome)
{
    if (BiomeDictionary.isBiomeOfType(biome, Type.SWAMP))
    {
        return 16;
    }
    if (BiomeDictionary.isBiomeOfType(biome, Type.CONIFEROUS))
    {
        return 10;
    }
    if (BiomeDictionary.isBiomeOfType(biome, Type.PLAINS))
    {
        return 6;
    }
    else
    {
        return 0;
    }
}
项目:AdvancedRocketry    文件:DimensionProperties.java   
/**
 * Adds all biomes of this type to the list of biomes allowed to generate
 * @param type
 */
public void addBiomeType(BiomeDictionary.Type type) {

    ArrayList<BiomeGenBase> entryList = new ArrayList<BiomeGenBase>();

    entryList.addAll(Arrays.asList(BiomeDictionary.getBiomesForType(type)));

    //Neither are acceptable on planets
    entryList.remove(BiomeGenBase.hell);
    entryList.remove(BiomeGenBase.sky);

    //Make sure we dont add double entries
    Iterator<BiomeGenBase> iter = entryList.iterator();
    while(iter.hasNext()) {
        BiomeGenBase nextbiome = iter.next();
        for(BiomeEntry entry : allowedBiomes) {
            if(BiomeDictionary.areBiomesEquivalent(entry.biome, nextbiome))
                iter.remove();
        }

    }
    allowedBiomes.addAll(getBiomesEntries(entryList));

}
项目:AdvancedRocketry    文件:DimensionProperties.java   
/**
 * Removes all biomes of this type from the list of biomes allowed to generate
 * @param type
 */
public void removeBiomeType(BiomeDictionary.Type type) {

    ArrayList<BiomeGenBase> entryList = new ArrayList<BiomeGenBase>();

    entryList.addAll(Arrays.asList(BiomeDictionary.getBiomesForType(type)));

    for(BiomeGenBase biome : entryList) {
        Iterator<BiomeEntry> iterator = allowedBiomes.iterator();
        while(iterator.hasNext()) {
            if(BiomeDictionary.areBiomesEquivalent(iterator.next().biome, biome))
                iterator.remove();
        }
    }

}
项目:RidiculousWorld    文件:BiomeGenCandy.java   
public BiomeGenCandy(int id){
    super(id);
    this.theBiomeDecorator.treesPerChunk = 6;
    this.theBiomeDecorator.grassPerChunk = 2;
    this.theBiomeDecorator.mushroomsPerChunk = 1;
    setDisableRain();
    setHeight(new BiomeGenBase.Height(1.5F, 0.5F));
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new SpawnListEntry(EntityPeep.class, 10, 4, 4));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityUnicorn.class, 10, 4, 4));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityCandySheep.class, 10, 4, 4));
    this.spawnableMonsterList.clear();
    this.spawnableMonsterList.add(new SpawnListEntry(EntityCalavera.class, 100, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityGingerbread.class, 100, 4, 6));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4));
    BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(this, Config.candyWeight));
    BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.LUSH);
    setBiomeName("Rock Candy Mountain");
    setColor(0x8AFFF0);
    this.waterColorMultiplier = 0x899CFF;
}
项目:RidiculousWorld    文件:BiomeGenMadness.java   
public BiomeGenMadness(int id)
{
    super(id);
    this.spawnableCreatureList.clear();
    this.theBiomeDecorator.treesPerChunk = -1;
    this.theBiomeDecorator.grassPerChunk = -1;
    this.theBiomeDecorator.mushroomsPerChunk = -1;
    this.topBlock = Blocks.packed_ice;
    this.fillerBlock = Blocks.packed_ice;
    this.spawnableCreatureList.clear();
    this.spawnableMonsterList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityShoggoth.class, 90, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 30, 1, 4));
    BiomeManager.addBiome(BiomeManager.BiomeType.ICY, new BiomeManager.BiomeEntry(this, Config.madnessWeight));
    BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(this, Config.madnessWeight));
    BiomeManager.addStrongholdBiome(this);
    BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.COLD, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.SNOWY);
    setBiomeName("Mountain of Madness");
    setTemperatureRainfall(0.05F, 0.5F);
    this.setHeight(BiomeGenBase.height_HighPlateaus);
    this.setColor(0x0E875B);
    this.waterColorMultiplier = 0x004A07;
}
项目:RidiculousWorld    文件:BiomeGenSpooky.java   
public BiomeGenSpooky(int id)
{
    super(id);
    this.spawnableCreatureList.clear();
    this.theBiomeDecorator.treesPerChunk = 10;
    this.theBiomeDecorator.grassPerChunk = 2;
    this.theBiomeDecorator.mushroomsPerChunk = 1;
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 10, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityFrankenstein.class, 90, 4, 4));
    BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeEntry(this, Config.spookyWeight));
    BiomeManager.addStrongholdBiome(this);
    BiomeDictionary.registerBiomeType(this, Type.SPOOKY, Type.MAGICAL, Type.FOREST);
    setBiomeName("Spooky Forest");
    setTemperatureRainfall(0.25F, 0.5F);
    setColor(0xF2A100);
    this.waterColorMultiplier = 0x970E0E;
}
项目:RidiculousWorld    文件:BiomeGenShadow.java   
BiomeGenShadow(int id){
    super(id);
    this.theBiomeDecorator.treesPerChunk = 0;
    this.theBiomeDecorator.flowersPerChunk = 0;
    this.theBiomeDecorator.deadBushPerChunk = 4;
    this.theBiomeDecorator.mushroomsPerChunk = 8;
    this.theBiomeDecorator.reedsPerChunk = 0;
    this.theBiomeDecorator.clayPerChunk = 1;
    this.theBiomeDecorator.waterlilyPerChunk = 0;
    this.theBiomeDecorator.sandPerChunk2 = 0;
    this.theBiomeDecorator.sandPerChunk = 0;
    this.theBiomeDecorator.grassPerChunk = 8;
    this.waterColorMultiplier = 0x00002F;
    this.flowers.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityShadowSlime.class, 60, 1, 1));
    BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(this, Config.shadowWeight));
    BiomeManager.addStrongholdBiome(this);
    BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.WET, BiomeDictionary.Type.SWAMP,
            BiomeDictionary.Type.COLD, BiomeDictionary.Type.MAGICAL);
    setBiomeName("Shadow Fen");
    setColor(0x3D3D3D);
    setHeight(height_PartiallySubmerged);
    setTemperatureRainfall(0.4F, 0.9F);
}
项目:MineFantasy    文件:EntitylistMF.java   
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature)
{
    for (BiomeGenBase biome : BiomeGenBase.biomeList)
    {
        if(biome != null)
        {
            if(BiomeDictionary.isBiomeRegistered(biome))
            {
                if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.END))
                {
                    return;
                }
                if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER))
                {
                    return;
                }
                if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MUSHROOM))
                {
                    return;
                }
            }

            EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biome);
        }
    }
}
项目:MineFantasy    文件:EntitylistMF.java   
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeDictionary.Type type)
{
    for (BiomeGenBase biome : BiomeGenBase.biomeList)
    {
        if(biome != null)
        {
            if(BiomeDictionary.isBiomeRegistered(biome))
            {
                if(BiomeDictionary.isBiomeOfType(biome, type))
                {
                    EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biome);
                }
            }
        }
    }
}
项目:AdventureBackpack2    文件:ItemSteamJetpack.java   
private int getBiomeMinTemp(EntityPlayer player, World world)
{
    BiomeDictionary.Type[] thisBiomeTypes = BiomeDictionary.getTypesForBiome(world.getBiomeGenForCoords((int) player.posX, (int) player.posZ));
    for (BiomeDictionary.Type type : thisBiomeTypes)
    {
        if (type == BiomeDictionary.Type.COLD || type == BiomeDictionary.Type.SNOWY)
        {
            return 0;
        }
        if (type == BiomeDictionary.Type.HOT || type == BiomeDictionary.Type.BEACH)
        {
            return 30;
        }
        if (type == BiomeDictionary.Type.NETHER)
        {
            return 40;
        }
    }
    return 25;
}
项目:Dimensional-Pockets    文件:BiomeHelper.java   
public static void init() {
    if (init) {
        DPLogger.severe("Tried calling BiomeHelper.init() again!");
        return;
    }
    init = true;

    pocketBiome = new BiomeGenBase(Reference.BIOME_ID) {
        @Override
        public boolean canSpawnLightningBolt() {
            return false;
        }

        @Override
        public List getSpawnableList(EnumCreatureType par1EnumCreatureType) {
            return Lists.newArrayList();
        }

        @Override
        public float getSpawningChance() {
            return 0.0F;
        }
    }.setBiomeName("Pocket Dimension").setDisableRain();

    BiomeDictionary.registerBiomeType(pocketBiome, Type.MAGICAL);
}
项目:Dendrology    文件:OverworldTreeGenerator.java   
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
                     IChunkProvider chunkProvider)
{
    final Settings settings = Settings.INSTANCE;
    if (settings.isOverworldTreeGenEnabled())
    {
        final int x = (chunkX << 4) + 8 + random.nextInt(16);
        final int z = (chunkZ << 4) + 8 + random.nextInt(16);

        final BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
        final List<Type> biomeTypes = ImmutableList.copyOf(BiomeDictionary.getTypesForBiome(biome));

        if (!(biomeTypes.contains(Type.NETHER) || biomeTypes.contains(Type.END)))
            if (random.nextInt(settings.overworldTreeGenRarity()) == 0)
            {
                final OverworldTreeSpecies species =
                        OverworldTreeSpecies.values()[random.nextInt(OverworldTreeSpecies.values().length)];
                final WorldGenerator tree = species.worldTreeGenerator();
                final int maxY = world.getHeightValue(x, z) * 2;
                final int y = maxY > 0 ? random.nextInt(maxY) : 0;
                tree.generate(world, random, x, y, z);
            }
    }
}
项目:GardenCollection    文件:WorldGenCandelilla.java   
@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);
}
项目:projectzulu1.7.10-pre-1.3a    文件:ProjectZulu_Core.java   
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    BiomeDictionary.registerAllBiomes();

    ProjectZuluLog.info("Registering Events");
    MinecraftForge.EVENT_BUS.register(new EventHookContainerClass());

    ProjectZuluLog.info("Load Entity Biomes");
    CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile);
    ProjectZuluLog.info("Register Entity Spawns");
    CustomEntityManager.INSTANCE.addSpawns();

    ProjectZuluLog.info("Initializing TerrainFeatures");
    featureGenerator.initialize(modConfigDirectoryFile);
    GameRegistry.registerWorldGenerator(featureGenerator, 1);
    for (ModuleInfo moduleInfo : modules) {
        if (moduleInfo.isEnabled) {
            moduleInfo.module.postInit(event, modConfigDirectoryFile);
        }
    }
}
项目:ForeCraft    文件:Station.java   
public static void setWeather(Temperature t, Humidity h, Pressure p, BiomeGenBase currBiome, int x, int y, int z, World world){

        /*
         *If the biome is not a vanilla biome, then use the dictionary 
         */

        if(BiomesHandler.vanillaBiomes.get(currBiome) == null){
            t.setTemperature(BiomesHandler.biomesMap.get(BiomeDictionary.getTypesForBiome(currBiome)[0]));
        }else{
            t.setTemperature(BiomesHandler.vanillaBiomes.get(currBiome));
        }
        p.setPressure(world.getTileEntity(x, y, z), currBiome);
        h.setHumidity(currBiome.rainfall * 100);        

        temperature = t.getTemperature();
        humidity = h.getHumidity();
        pressure = p.getPressure();
    }
项目:The-Derpy-Shiz-Mod    文件:DerpyWorld.java   
public void main() {
    //Ores
    GameRegistry.registerWorldGenerator(new WorldGenDerpyOres(), 42);

    //Biome
    BiomeGenBase magicBiome = new MagicBiomeGen(Main.idMagicBiome);
    BiomeDictionary.registerBiomeType(magicBiome, BiomeDictionary.Type.MAGICAL);
    BiomeManager.addBiome(BiomeType.COOL, new BiomeEntry(magicBiome, 10));
    BiomeManager.addSpawnBiome(magicBiome);

    //Trees
    GameRegistry.registerWorldGenerator(new DerpyTreeGen(new WorldGenMagicTree(false),magicBiome,9,1),42);
    GameRegistry.registerWorldGenerator(new DerpyTreeGen(new WorldGenEbonyTree(false),magicBiome,10,1),42);

    BiomeGenBase[] forests = BiomeDictionary.getBiomesForType(Type.FOREST);
    for (int i=0;i<forests.length;i++) {
        BiomeGenBase b = forests[i];
        GameRegistry.registerWorldGenerator(new DerpyTreeGen(new WorldGenEbonyTree(false),b,2,3),1);
    }
}
项目:EnderZoo    文件:AbstractBiomeFilter.java   
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;
}
项目:EnderZoo    文件:BiomeFilterAll.java   
@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;
}
项目:projectzulu1.7.10    文件:ProjectZulu_Core.java   
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    BiomeDictionary.registerAllBiomes();

    ProjectZuluLog.info("Registering Events");
    MinecraftForge.EVENT_BUS.register(new EventHookContainerClass());

    ProjectZuluLog.info("Load Entity Biomes");
    CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile);
    ProjectZuluLog.info("Register Entity Spawns");
    CustomEntityManager.INSTANCE.addSpawns();

    ProjectZuluLog.info("Initializing TerrainFeatures");
    featureGenerator.initialize(modConfigDirectoryFile);
    GameRegistry.registerWorldGenerator(featureGenerator, 1);
    for (ModuleInfo moduleInfo : modules) {
        if (moduleInfo.isEnabled) {
            moduleInfo.module.postInit(event, modConfigDirectoryFile);
        }
    }
}
项目:ComplexWiring    文件:DecorGenerator.java   
public void generate(World world, int chunkX, int chunkZ, Random rand, BiomeDictionary.Type... biomeTypes) {
    boolean doGenerate = false;
    for (BiomeDictionary.Type type : biomeTypes) {
        if (BiomeDictionary.isBiomeOfType(world.getBiomeGenForCoords(chunkX + 8, chunkZ + 8), type)) {
            doGenerate = true;
        }
    }
    if (doGenerate) {
        for (int i = 0; i < clusterNum; i++) {
            int x = chunkX + rand.nextInt(16);
            int y = rand.nextInt(Math.max(maxY - minY, 0) + minY);
            int z = chunkZ + rand.nextInt(16);
            generateMinable(world, rand, x, y, z);
        }
        world.getChunkFromChunkCoords(chunkX, chunkZ).setChunkModified();
    }
}