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


Java Biomes类代码示例

本文整理汇总了Java中net.minecraft.init.Biomes的典型用法代码示例。如果您正苦于以下问题:Java Biomes类的具体用法?Java Biomes怎么用?Java Biomes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getPossibleCreatures

import net.minecraft.init.Biomes; //导入依赖的package包/类
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) {
	if (pos==null) return ImmutableList.of();
	
	if (creatureType == EnumCreatureType.MONSTER) {
           //if (this.genNetherBridge.isInsideStructure(pos)) {
           //    return this.genNetherBridge.getSpawnList();
           //}

           if (this.genNetherBridge.isPositionInStructure(this.world, pos) && this.world.getBlockState(pos.down()).getBlock() == Blocks.NETHER_BRICK) {
               return this.genNetherBridge.getSpawnList();
           }
           
           return Biomes.HELL.getSpawnableList(EnumCreatureType.MONSTER); //TODO: Replace with actual-biome lists.
	}
	return ImmutableList.of();

	//Biome biome = this.world.getBiome(pos);
	//return biome.getSpawnableList(creatureType);
}
 
开发者ID:elytra,项目名称:ThermionicsWorld,代码行数:20,代码来源:ChunkProviderNeo.java

示例2: updateTick

import net.minecraft.init.Biomes; //导入依赖的package包/类
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
    super.updateTick(worldIn, pos, state, rand);
    if (!worldIn.isRemote) {
        if (state.getValue(AGE) == 2) {
            EntityFaerie faerie = new EntityFaerie(worldIn, 4.0D, 0, 0.1F, 1);
            faerie.setPosition((double) pos.getX(), (double) pos.up().getY(), (double) pos.getZ());
            worldIn.spawnEntity(faerie);
        }
        if (!(worldIn.getBiome(pos) == Biomes.FOREST ||
                worldIn.getBiome(pos) == Biomes.FOREST_HILLS ||
                worldIn.getBiome(pos) == Biomes.TAIGA ||
                worldIn.getBiome(pos) == Biomes.TAIGA_HILLS) && state.getValue(AGE) >= 1) {
            worldIn.setBlockState(pos, state.withProperty(AGE, 0));
        }
    }

}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:19,代码来源:BlockNightshadeCrop.java

示例3: generate

import net.minecraft.init.Biomes; //导入依赖的package包/类
@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);
			}
		}
	}
}
 
开发者ID:elucent,项目名称:SimplyTea,代码行数:17,代码来源:SimplyTea.java

示例4: init

import net.minecraft.init.Biomes; //导入依赖的package包/类
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()]));
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:18,代码来源:InfernumEntities.java

示例5: getFromBiome

import net.minecraft.init.Biomes; //导入依赖的package包/类
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;
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:20,代码来源:Anima.java

示例6: createBiomeProvider

import net.minecraft.init.Biomes; //导入依赖的package包/类
/**
 * creates a new world chunk manager for WorldProvider
 */
protected void createBiomeProvider()
{
    this.field_191067_f = true;
    WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType();

    if (worldtype == WorldType.FLAT)
    {
        FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions());
        this.biomeProvider = new BiomeProviderSingle(Biome.getBiome(flatgeneratorinfo.getBiome(), Biomes.DEFAULT));
    }
    else if (worldtype == WorldType.DEBUG_WORLD)
    {
        this.biomeProvider = new BiomeProviderSingle(Biomes.PLAINS);
    }
    else
    {
        this.biomeProvider = new BiomeProvider(this.worldObj.getWorldInfo());
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:23,代码来源:WorldProvider.java

示例7: getBestBiome

import net.minecraft.init.Biomes; //导入依赖的package包/类
public Biome getBestBiome(int x, int z) {
    double weight = Double.MIN_VALUE;
    BiomeGroup bestGroup = null;

    Map<BiomeGroup,Double> weights = getBiomeWeights(x,z, this.noise);

    double w;
    for (BiomeGroup b : weights.keySet()) {
        w = weights.get(b);
        if (w > weight) {
            bestGroup = b;
            weight = w;
        }
    }

    if (bestGroup == null) {
        return Biomes.DEFAULT;
    }

    return getSubBiomeForPosition(x,z, bestGroup);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:22,代码来源:BiomeProviderATG.java

示例8: getBiome

import net.minecraft.init.Biomes; //导入依赖的package包/类
public Biome getBiome(BlockPos pos, BiomeProvider provider)
{
    int i = pos.getX() & 15;
    int j = pos.getZ() & 15;
    int k = this.blockBiomeArray[j << 4 | i] & 255;

    if (k == 255)
    {
        Biome biome = provider.getBiome(pos, Biomes.PLAINS);
        k = Biome.getIdForBiome(biome);
        this.blockBiomeArray[j << 4 | i] = (byte)(k & 255);
    }

    Biome biome1 = Biome.getBiome(k);
    return biome1 == null ? Biomes.PLAINS : biome1;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:Chunk.java

示例9: Start

import net.minecraft.init.Biomes; //导入依赖的package包/类
public Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<StructureVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_)
{
    super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_);
    this.worldChunkMngr = chunkManagerIn;
    this.structureVillageWeightedPieceList = p_i2104_6_;
    this.terrainType = p_i2104_7_;
    Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT);

    if (biome instanceof BiomeDesert)
    {
        this.structureType = 1;
    }
    else if (biome instanceof BiomeSavanna)
    {
        this.structureType = 2;
    }
    else if (biome instanceof BiomeTaiga)
    {
        this.structureType = 3;
    }

    this.func_189924_a(this.structureType);
    this.isZombieInfested = rand.nextInt(50) == 0;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:StructureVillagePieces.java

示例10: Start

import net.minecraft.init.Biomes; //导入依赖的package包/类
public Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<StructureVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_)
{
    super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_);
    this.worldChunkMngr = chunkManagerIn;
    this.structureVillageWeightedPieceList = p_i2104_6_;
    this.terrainType = p_i2104_7_;
    Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT);
    this.biome = biome;
    this.startPiece = this;

    if (biome instanceof BiomeDesert)
    {
        this.structureType = 1;
    }
    else if (biome instanceof BiomeSavanna)
    {
        this.structureType = 2;
    }
    else if (biome instanceof BiomeTaiga)
    {
        this.structureType = 3;
    }

    this.func_189924_a(this.structureType);
    this.isZombieInfested = rand.nextInt(50) == 0;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:StructureVillagePieces.java

示例11: coralPassGenerate

import net.minecraft.init.Biomes; //导入依赖的package包/类
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);
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:19,代码来源:ExPBiomeDecorator.java

示例12: modifiedIncidence

import net.minecraft.init.Biomes; //导入依赖的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

示例13: getInts

import net.minecraft.init.Biomes; //导入依赖的package包/类
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4)
{
    int[] aint = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
    int[] aint1 = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; ++i1)
    {
        for (int j1 = 0; j1 < par3; ++j1)
        {
            this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
            int k1 = aint[j1 + 1 + (i1 + 1) * (par3 + 2)];

            if ((k1 != Biome.getIdForBiome(Biomes.SWAMPLAND) || this.nextInt(6) != 0) && (k1 != Biome.getIdForBiome(Biomes.JUNGLE) && k1 != Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || this.nextInt(8) != 0))
            {
                aint1[j1 + i1 * par3] = k1;
            }
            else
            {
                aint1[j1 + i1 * par3] = Biome.getIdForBiome(Biomes.RIVER);
            }
        }
    }

    return aint1;
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:30,代码来源:GenLayerSwampRivers.java

示例14: getInts

import net.minecraft.init.Biomes; //导入依赖的package包/类
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4){
    int i1 = par1 ;
    int j1 = par2 ;
    int parentSpan = par3;
    int l1 = par4;
    int[] aint = this.parent.getInts(i1, j1, parentSpan, l1);

    // not sure what's x and z but I need readable variable names
    for (int z = 0; z < par4; z++)
    {
        for (int x = 0; x < par3; x++)
        {
            int center = aint[x  + (z) * parentSpan];

            //logger.info("at "+(x  + (z) * parentSpan)+", "+center);
            if (center == Biome.getIdForBiome(Biomes.PLAINS)) throw new RuntimeException("at "+(x  + (z) * parentSpan));

        }
    }

    return aint;
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:27,代码来源:GenLayerNoPlains.java

示例15: decorate

import net.minecraft.init.Biomes; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void decorate(DecorateBiomeEvent.Decorate event) {
	World world = event.getWorld();
	Biome biome = world.getBiomeGenForCoords(event.getPos());
	Random rand = event.getRand();

	if ((biome == Biomes.PLAINS || biome == Biomes.ICE_PLAINS || biome == Biomes.MUTATED_PLAINS || biome == Biomes.EXTREME_HILLS_WITH_TREES || biome == Biomes.MUTATED_EXTREME_HILLS_WITH_TREES) && event.getType() == DecorateBiomeEvent.Decorate.EventType.TREE) {
		if (rand.nextDouble() > 0.1) return;
		int x = rand.nextInt(16) + 8;
		int y = rand.nextInt(16) + 8;

		TintedTreeGenerator gen = new TintedTreeGenerator();

		gen.generateTree(rand, world, world.getHeight(event.getPos().add(x, 0, y)));

		event.setResult(Event.Result.DENY);
	}
}
 
开发者ID:yolp900,项目名称:ItsJustaCharm1.10.2Dead,代码行数:19,代码来源:EventTintedTreeGenerator.java


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