当前位置: 首页>>代码示例>>Java>>正文


Java BiomeDictionary.isBiomeOfType方法代码示例

本文整理汇总了Java中net.minecraftforge.common.BiomeDictionary.isBiomeOfType方法的典型用法代码示例。如果您正苦于以下问题:Java BiomeDictionary.isBiomeOfType方法的具体用法?Java BiomeDictionary.isBiomeOfType怎么用?Java BiomeDictionary.isBiomeOfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.BiomeDictionary的用法示例。


在下文中一共展示了BiomeDictionary.isBiomeOfType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: modifiedIncidence

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
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;
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:25,代码来源:MountainFormer.java

示例2: isValidPosition

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@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;
}
 
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:21,代码来源:SurfaceResourceGenerator.java

示例3: isMatchingBiome

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@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; 
}
 
开发者ID:SleepyTrousers,项目名称:Structures,代码行数:17,代码来源:BiomeFilterAll.java

示例4: biomeMultiplyer

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
/**
 * 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;
	}
}
 
开发者ID:VapourDrive,项目名称:HarderStart,代码行数:27,代码来源:HS_WorldGenHandler.java

示例5: addSpawn

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
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);
    	}
    }
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:27,代码来源:EntitylistMF.java

示例6: generate

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@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);
}
 
开发者ID:jaquadro,项目名称:GardenCollection,代码行数:22,代码来源:WorldGenCandelilla.java

示例7: generate

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:Numerios,项目名称:ComplexWiring,代码行数:18,代码来源:DecorGenerator.java

示例8: genOre

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
/**
 * Generates ores into the world dependant on biomes
 * @param world World object
 * @param random Random object
 * @param chunkX Chunk X coord
 * @param chunkZ Chunk Z coord
 * @param genCount How many veins to generate per chunk
 * @param generator The WorldGenMinable object for the ore
 * @param minHeight The minimum height the veins will spawn at
 * @param maxHeight The maximum height the veins will spawn at
 * @param biomes The biomes the veins will spawn in
 */
private void genOre(World world, Random random, int chunkX, int chunkZ, int genCount, WorldGenMinable generator, int minHeight, int maxHeight, BiomeDictionary.Type... biomes)
{
    //Some vanilla checks for the height limits
    if (maxHeight < minHeight)
    {
        int i = minHeight;
        minHeight = maxHeight;
        maxHeight = i;
    }
    else if (maxHeight == minHeight)
    {
        if (minHeight < 255)
        {
            ++maxHeight;
        }
        else
        {
            --minHeight;
        }
    }

    for(int i = 0; i < genCount; i++)
    {
        //Creates random position in chunk for vein
        BlockPos pos = getRandXZInChunk(random, chunkX, random.nextInt(maxHeight - minHeight) + minHeight, chunkZ);
        //Generates vein
        for(BiomeDictionary.Type biome : biomes) {
            if(BiomeDictionary.isBiomeOfType(world.getBiome(pos),biome))
                generator.generate(world, random, pos);
        }
    }
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:45,代码来源:WorldGenHandler.java

示例9: isValidPosition

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@Override
public boolean isValidPosition(World world, BlockPos pos)
{
	IBlockState self = world.getBlockState(pos);
	return pos.getY() < 50 && (self.getBlock() == Blocks.WATER || self.getBlock() == Blocks.FLOWING_WATER)
			&& BiomeDictionary.isBiomeOfType(world.getBiomeForCoordsBody(pos), BiomeDictionary.Type.OCEAN);
}
 
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:8,代码来源:OceanResourceGenerator.java

示例10: isBadBiome

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
boolean isBadBiome(World w, int chunkX, int chunkZ) {
    BiomeGenBase biome = w.getBiomeGenForCoords(new BlockPos(8 + chunkX * 16, 64, 8 + chunkZ * 16));
    for (Type bad : forbiddenBiomeTypes) {
        if (BiomeDictionary.isBiomeOfType(biome, bad)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:10,代码来源:WorldGenColossus.java

示例11: trySpawnQuarriedStone

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
	boolean flag = false;
	if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) {
		ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
		if (item != null) {
			world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
			flag = true;
		}
	}
	return flag;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:12,代码来源:TransmutationEffectRailcraft.java

示例12: trySpawnAbyssalStone

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
	boolean flag = false;
	if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) && !biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) {
		ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1);
		if (item != null) {
			world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
			flag = true;
		}
	}
	return flag;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:12,代码来源:TransmutationEffectRailcraft.java

示例13: trySpawnSandstone

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
	boolean flag = false;
	if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) && OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) {
		world.setBlock(x, y, z, Blocks.sandstone);
		flag = true;
	}
	return flag;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:9,代码来源:TransmutationEffectVanilla.java

示例14: isMatchingBiome

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
@Override
public boolean isMatchingBiome(BiomeGenBase biome) {
  if(isExcluded(biome)) {
    return false;
  }
  if(names.contains(biome.biomeName)) {
    return true;
  }
  for(BiomeDictionary.Type type : types) {
    if(BiomeDictionary.isBiomeOfType(biome, type)) {
      return true;
    }
  }   
  return false;        
}
 
开发者ID:SleepyTrousers,项目名称:Structures,代码行数:16,代码来源:BiomeFilterAny.java

示例15: isExcluded

import net.minecraftforge.common.BiomeDictionary; //导入方法依赖的package包/类
protected boolean isExcluded(BiomeGenBase candidate) {
  for (BiomeDictionary.Type exType : typeExcludes) {
    if(BiomeDictionary.isBiomeOfType(candidate, exType)) {       
      return true;

    }
  }
  for (String exName : nameExcludes) {
    if(exName != null && exName.equals(candidate.biomeName)) {
      System.out.print("Excluded " + candidate.biomeName + ", ");
      return false;
    }
  }
  return false;
}
 
开发者ID:SleepyTrousers,项目名称:Structures,代码行数:16,代码来源:AbstractBiomeFilter.java


注:本文中的net.minecraftforge.common.BiomeDictionary.isBiomeOfType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。