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


Java Biome.getBiome方法代码示例

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


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

示例1: handleData

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
@Override
public void handleData(NBTTagCompound data)
{
	Biome b = Biome.getBiome(data.getInteger("biomeID"));
	DimBlockPos dbp = SerializationUtils.deserialize(data.getByteArray("blockPosData"));
	if (MC.getSide() == Side.CLIENT)
	{
		VoidApi.proxy.getClientListener().addScheduledTask(() -> {
				if (VoidApi.proxy.getClientWorld().isBlockLoaded(dbp.pos))
					ChunkUtils.setBiomeAt(b, dbp.pos, VoidApi.proxy.getClientWorld());}
		);
	}
	else
	{
		WorldServer ws = DimensionManager.getWorld(dbp.dim);
		ws.addScheduledTask(() -> {
				if (ws.isBlockLoaded(dbp.pos))
					ChunkUtils.setBiomeAt(b, dbp.pos, ws);}
		);
	}
}
 
开发者ID:V0idWa1k3r,项目名称:VoidApi,代码行数:22,代码来源:HandlerBiome.java

示例2: 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:NSExceptional,项目名称:Zombe-Modpack,代码行数:23,代码来源:WorldProvider.java

示例3: getBiome

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

示例4: 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:sudofox,项目名称:Backmemed,代码行数:28,代码来源:GenLayerBiomeEdge.java

示例5: generate

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
	byte b = world.getChunkFromChunkCoords(chunkX, chunkZ).getBiomeArray()[0];
	FirmaTree[] tl = FirmaBiome.getTreeForBiome(b, chunkZ*16);
	if(tl.length==0){ return; }
	FirmaTree ft = tl[random.nextInt(tl.length)];
	FirmaBiome bi = (FirmaBiome) Biome.getBiome(b);
	for(int i = 0; i < bi.treeCount; i++){
		ft.generate(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
	}
}
 
开发者ID:trigg,项目名称:Firma,代码行数:12,代码来源:FirmaTreeGen.java

示例6: printBiomeInformation

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public static void printBiomeInformation() {
    ExampleMod.logger.info("-------------------------------------------------------------------------------------------------------------");
    ExampleMod.logger.info("Biome Information");
    ExampleMod.logger.info("-------------------------------------------------------------------------------------------------------------");
    ExampleMod.logger.info("ID  | Location                                           | Name");

    Biome biome;
    String output, name, prettyName;

    for (int id = 0; id<256; id++) {
        biome = Biome.getBiome(id);
        name = "-";
        prettyName = "-";
        if (biome != null) {
            name = biome.getRegistryName().toString();
            prettyName = biome.getBiomeName();
        }

        output = "" + id;
        output = padString(output, ' ', 3);
        output += " | ";
        output += padString(prettyName, ' ', 50);
        output += " | ";
        output += padString(name, ' ', 50);

        ExampleMod.logger.info(output);
    }

    ExampleMod.logger.info("-------------------------------------------------------------------------------------------------------------");
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:31,代码来源:GeneralUtil.java

示例7: biomesEqualOrMesaPlateau

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
protected static boolean biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB)
{
    if (biomeIDA == biomeIDB)
    {
        return true;
    }
    else
    {
        Biome biome = Biome.getBiome(biomeIDA);
        Biome biome1 = Biome.getBiome(biomeIDB);
        return biome != null && biome1 != null ? (biome != Biomes.MESA_ROCK && biome != Biomes.MESA_CLEAR_ROCK ? biome == biome1 || biome.getBiomeClass() == biome1.getBiomeClass() : biome1 == Biomes.MESA_ROCK || biome1 == Biomes.MESA_CLEAR_ROCK) : false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:GenLayer.java

示例8: readFromNBT

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound nbt)
{
    super.readFromNBT(nbt);
    if(nbt.hasKey("biome_id"))
        this.targetBiome = Biome.getBiome(nbt.getByte("biome_id"), Biomes.OCEAN);
    if(nbt.hasKey("world_id"))
        this.worldId = nbt.getInteger("world_id");
}
 
开发者ID:Lumaceon,项目名称:CraftingParadiseMod,代码行数:10,代码来源:TileBiomeChanger.java

示例9: isBiomeOceanic

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
/**
 * returns true if the biomeId is one of the various ocean biomes.
 */
protected static boolean isBiomeOceanic(int p_151618_0_)
{
    Biome biome = Biome.getBiome(p_151618_0_);
    return biome == Biomes.OCEAN || biome == Biomes.DEEP_OCEAN || biome == Biomes.FROZEN_OCEAN;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:GenLayer.java

示例10: isJungleCompatible

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
private boolean isJungleCompatible(int p_151631_1_)
{
    return Biome.getBiome(p_151631_1_) != null && Biome.getBiome(p_151631_1_).getBiomeClass() == BiomeJungle.class ? true : p_151631_1_ == Biome.getIdForBiome(Biomes.JUNGLE_EDGE) || p_151631_1_ == Biome.getIdForBiome(Biomes.JUNGLE) || p_151631_1_ == Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || p_151631_1_ == Biome.getIdForBiome(Biomes.FOREST) || p_151631_1_ == Biome.getIdForBiome(Biomes.TAIGA) || isBiomeOceanic(p_151631_1_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:GenLayerShore.java

示例11: isMesa

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
private boolean isMesa(int p_151633_1_)
{
    return Biome.getBiome(p_151633_1_) instanceof BiomeMesa;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:GenLayerShore.java


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