本文整理汇总了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);}
);
}
}
示例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());
}
}
示例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;
}
示例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;
}
}
}
示例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);
}
}
示例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("-------------------------------------------------------------------------------------------------------------");
}
示例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;
}
}
示例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");
}
示例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;
}
示例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_);
}
示例11: isMesa
import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
private boolean isMesa(int p_151633_1_)
{
return Biome.getBiome(p_151633_1_) instanceof BiomeMesa;
}