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


Java Biome类代码示例

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


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

示例1: GameData

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
public GameData()
{
    iBlockRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.BLOCKS, Block.class, new ResourceLocation("minecraft:air"), MIN_BLOCK_ID, MAX_BLOCK_ID, true, BlockCallbacks.INSTANCE, BlockCallbacks.INSTANCE, BlockCallbacks.INSTANCE, BlockCallbacks.INSTANCE);
    iItemRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.ITEMS, Item.class, null, MIN_ITEM_ID, MAX_ITEM_ID, true, ItemCallbacks.INSTANCE, ItemCallbacks.INSTANCE, ItemCallbacks.INSTANCE, ItemCallbacks.INSTANCE);
    iPotionRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.POTIONS, Potion.class, null, MIN_POTION_ID, MAX_POTION_ID, false, PotionCallbacks.INSTANCE, PotionCallbacks.INSTANCE, PotionCallbacks.INSTANCE, null);
    iBiomeRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.BIOMES, Biome.class, null, MIN_BIOME_ID, MAX_BIOME_ID, false, BiomeCallbacks.INSTANCE, BiomeCallbacks.INSTANCE, BiomeCallbacks.INSTANCE, null);
    iSoundEventRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.SOUNDEVENTS, SoundEvent.class, null, MIN_SOUND_ID, MAX_SOUND_ID, false, null, null, null, null);
    ResourceLocation WATER = new ResourceLocation("water");
    iPotionTypeRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.POTIONTYPES, PotionType.class, WATER, MIN_POTIONTYPE_ID, MAX_POTIONTYPE_ID, false, null, null, null, null);
    iEnchantmentRegistry = PersistentRegistryManager.createRegistry(PersistentRegistryManager.ENCHANTMENTS, Enchantment.class, null, MIN_ENCHANTMENT_ID, MAX_ENCHANTMENT_ID, false, null, null, null, null);

    try
    {
        blockField = FinalFieldHelper.makeWritable(ReflectionHelper.findField(ItemBlock.class, "block", "field_150939" + "_a"));
    }
    catch (Exception e)
    {
        FMLLog.log(Level.FATAL, e, "Cannot access the 'block' field from ItemBlock, this is fatal!");
        throw Throwables.propagate(e);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:GameData.java

示例2: getPossibleCreatures

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos)
{
    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();
        }
    }

    Biome biome = this.world.getBiome(pos);
    return biome.getSpawnableList(creatureType);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:ChunkProviderHell.java

示例3: provideChunk

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
@Override
public Chunk provideChunk(int x, int z) {

	this.rand.setSeed(x * 341873128712L + z * 132897987541L);
	ChunkPrimer chunkprimer = new ChunkPrimer();
	this.setBlocksInChunk(x, z, chunkprimer);
	Biome[] biomesForGeneration = this.replaceBiomeBlocks(x, z, chunkprimer);
	this.caveGenerator.generate(this.world, x, z, chunkprimer);
	this.ravineGenerator.generate(world, x, z, chunkprimer);
	Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
	byte[] abyte = chunk.getBiomeArray();

	for (int i = 0; i < abyte.length; i++) {
		abyte[i] = (byte) Biome.getIdForBiome(biomesForGeneration[i + 19]);
	}
	chunk.setBiomeArray(abyte);
	chunk.generateSkylightMap();

	return chunk;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:21,代码来源:FirmaChunkGen.java

示例4: Start

import net.minecraft.world.biome.Biome; //导入依赖的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

示例5: prep

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
public static void prep() {
	OCEAN = Biome.getIdForBiome(FirmaBiome.OCEAN);
	DOCEAN = Biome.getIdForBiome(FirmaBiome.DEEPOCEAN);
	LAKE = Biome.getIdForBiome(FirmaBiome.LAKE);
	RIVER = Biome.getIdForBiome(FirmaBiome.RIVER);
	PLAINS = Biome.getIdForBiome(FirmaBiome.PLAINS);
	HILLS = Biome.getIdForBiome(FirmaBiome.HILLS);
	EXHILLS = Biome.getIdForBiome(FirmaBiome.EXHILLS);
	HILLSEDGE = Biome.getIdForBiome(FirmaBiome.HILLSEDGE);
	EXHILLSEDGE = Biome.getIdForBiome(FirmaBiome.EXHILLSEDGE);
	SWAMP = Biome.getIdForBiome(FirmaBiome.SWAMP);
	BEACH = Biome.getIdForBiome(FirmaBiome.BEACH);
	GBEACH = Biome.getIdForBiome(FirmaBiome.GRAVELBEACH);
	FOREST = Biome.getIdForBiome(FirmaBiome.FOREST);

}
 
开发者ID:trigg,项目名称:Firma,代码行数:17,代码来源:Layer.java

示例6: getInts

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
/**
 * Takes Continent data (only 0's and 1's) and for anything not ocean it throws any of the allowed biomes back. Can't help but wonder if I could do better than "Any of allowed" and possibly have hills mostly in-land etc. Will have to see
 */
@Override
public int[] getInts(int x, int y, int w, int h)
{
	int[] parentInts = this.parent.getInts(x, y, w, h);
	int[] newInts = IntCache.getIntCache(w * h);

	for (int currentX = 0; currentX < h; ++currentX)
	{
		for (int currentY = 0; currentY < w; ++currentY)
		{
			this.initChunkSeed(currentY + x, currentX + y);
			int id = parentInts[currentY + currentX * w];
			newInts[currentY+currentX*w]=id;
			if (id==0){
				newInts[currentY + currentX * w] = Layer.OCEAN;
			}else if(id==Layer.DOCEAN){
				continue;
			}else{ 
				newInts[currentY + currentX * w] = Biome.getIdForBiome(this.allowedBiomes[this.nextInt(this.allowedBiomes.length)]);
			}
		}
	}
	validateIntArray(newInts, w, h);
	return newInts;
}
 
开发者ID:trigg,项目名称:Firma,代码行数:29,代码来源:FirmaGenLayerBiome.java

示例7: BiomeTropicalShrubland

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
public BiomeTropicalShrubland() {
    super(new Biome.BiomeProperties("Tropical Shrubland")
            .setBaseHeight(0.105f)
            .setHeightVariation(0.15f)
            .setTemperature(1.1f)
            .setRainfall(0.45f)
    );

    this.setRegistryName(Ref.MODID+":tropical_shrubland");
    this.decorator.treesPerChunk = 5;
    this.decorator.grassPerChunk = 10;
    this.decorator.flowersPerChunk = 4;

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 5, 4, 4));
    Ref.BIOMES.add(this);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:17,代码来源:BiomeTropicalShrubland.java

示例8: genDecorations

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
@Override
protected void genDecorations(Biome biomeIn, World worldIn, Random random) {
	 			 	
	 	int k1 = this.treesPerChunk;
        if (random.nextFloat() < this.extraTreeChance)
        {
            ++k1;
        }

        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE))
        for (int j2 = 0; j2 < k1; ++j2)
        {
            int k6 = random.nextInt(16) + 8;
            int l = random.nextInt(16) + 8;
            WorldGenAbstractTree worldgenabstracttree = biomeIn.getRandomTreeFeature(random);
            worldgenabstracttree.setDecorationDefaults();
            BlockPos blockpos = worldIn.getHeight(this.chunkPos.add(k6, 0, l));

            if (worldgenabstracttree.generate(worldIn, random, blockpos))
            {
                worldgenabstracttree.generateSaplings(worldIn, random, blockpos);
            }
        }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:25,代码来源:PontusBiomeDecorator.java

示例9: canBiomesBeNeighbors

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
/**
 * Returns if two biomes can logically be neighbors. If one is hot and the other cold, for example, it returns
 * false.
 */
private boolean canBiomesBeNeighbors(int p_151634_1_, int p_151634_2_)
{
    if (biomesEqualOrMesaPlateau(p_151634_1_, p_151634_2_))
    {
        return true;
    }
    else
    {
        Biome biome = Biome.getBiome(p_151634_1_);
        Biome biome1 = Biome.getBiome(p_151634_2_);

        if (biome != null && biome1 != null)
        {
            Biome.TempCategory biome$tempcategory = biome.getTempCategory();
            Biome.TempCategory biome$tempcategory1 = biome1.getTempCategory();
            return biome$tempcategory == biome$tempcategory1 || biome$tempcategory == Biome.TempCategory.MEDIUM || biome$tempcategory1 == Biome.TempCategory.MEDIUM;
        }
        else
        {
            return false;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:GenLayerBiomeEdge.java

示例10: createBiomeProvider

import net.minecraft.world.biome.Biome; //导入依赖的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:sudofox,项目名称:Backmemed,代码行数:23,代码来源:WorldProvider.java

示例11: onPotentialSpawns

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
@SubscribeEvent
public void onPotentialSpawns(WorldEvent.PotentialSpawns event) {
    int i = 0;
    for (PotentialSpawnRule rule : RulesManager.potentialSpawnRules) {
        if (rule.match(event)) {

            // First remove mob entries if needed
            for (Class clazz : rule.getToRemoveMobs()) {
                for (int idx = event.getList().size()-1 ; idx >= 0 ; idx--) {
                    if (event.getList().get(idx).entityClass == clazz) {
                        event.getList().remove(idx);
                    }
                }
            }

            List<Biome.SpawnListEntry> spawnEntries = rule.getSpawnEntries();
            for (Biome.SpawnListEntry entry : spawnEntries) {
                if (debug) {
                    InControl.logger.log(Level.INFO, "Potential " + i + ": "+ entry.entityClass.toString());
                }
                event.getList().add(entry);
            }
        }
        i++;
    }
}
 
开发者ID:McJty,项目名称:InControl,代码行数:27,代码来源:ForgeEventHandlers.java

示例12: onLivingUpdate

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
@SubscribeEvent
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
    if (!(event.getEntity() instanceof EntityPlayer)) {
        return;
    }
    EntityPlayer player = (EntityPlayer) event.getEntity();
    if (player.isDead) {
        this.hueManager.adjustColor(new Color(255, 0, 0));
        return;
    }
    BlockPos pos = player.getPosition();
    Chunk chunk = this.world.getChunkFromBlockCoords(pos);
    Biome biome = chunk.getBiome(pos, this.world.getBiomeProvider());
    String color = this.biomeMap.get(biome.getRegistryName().getResourcePath());
    if (color != null) {
        this.hueManager.adjustColor(color);
    }
}
 
开发者ID:remcohaszing,项目名称:minecraft-hue,代码行数:19,代码来源:EventListener.java

示例13: getBestBiome

import net.minecraft.world.biome.Biome; //导入依赖的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

示例14: BiomeShrubland

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
public BiomeShrubland() {
    super(new BiomeProperties("Shrubland")
            .setBaseHeight(0.115f)
            .setHeightVariation(0.1f)
            .setTemperature(0.77f)
            .setRainfall(0.53f)
    );

    this.setRegistryName(Ref.MODID+":shrubland");
    this.decorator.treesPerChunk = 1;
    this.decorator.grassPerChunk = 7;
    this.decorator.flowersPerChunk = 3;

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityHorse.class, 2, 2, 4));
    Ref.BIOMES.add(this);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:17,代码来源:BiomeShrubland.java

示例15: getColorGrid

import net.minecraft.world.biome.Biome; //导入依赖的package包/类
private int getColorGrid(Biome p_getColorGrid_1_, BlockPos p_getColorGrid_2_)
{
    int i = Biome.getIdForBiome(p_getColorGrid_1_);
    int j = p_getColorGrid_2_.getY() - this.yOffset;

    if (this.yVariance > 0)
    {
        int k = p_getColorGrid_2_.getX() << 16 + p_getColorGrid_2_.getZ();
        int l = Config.intHash(k);
        int i1 = this.yVariance * 2 + 1;
        int j1 = (l & 255) % i1 - this.yVariance;
        j += j1;
    }

    return this.getColor(i, j);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:CustomColormap.java


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