本文整理汇总了Java中net.minecraft.world.biome.BiomeGenBase.deepOcean方法的典型用法代码示例。如果您正苦于以下问题:Java BiomeGenBase.deepOcean方法的具体用法?Java BiomeGenBase.deepOcean怎么用?Java BiomeGenBase.deepOcean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.biome.BiomeGenBase
的用法示例。
在下文中一共展示了BiomeGenBase.deepOcean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canSpawnStructureAtCoords
import net.minecraft.world.biome.BiomeGenBase; //导入方法依赖的package包/类
protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ)
{
int i = chunkX;
int j = chunkZ;
if (chunkX < 0)
{
chunkX -= this.field_175800_f - 1;
}
if (chunkZ < 0)
{
chunkZ -= this.field_175800_f - 1;
}
int k = chunkX / this.field_175800_f;
int l = chunkZ / this.field_175800_f;
Random random = this.worldObj.setRandomSeed(k, l, 10387313);
k = k * this.field_175800_f;
l = l * this.field_175800_f;
k = k + (random.nextInt(this.field_175800_f - this.field_175801_g) + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2;
l = l + (random.nextInt(this.field_175800_f - this.field_175801_g) + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2;
if (i == k && j == l)
{
if (this.worldObj.getWorldChunkManager().getBiomeGenerator(new BlockPos(i * 16 + 8, 64, j * 16 + 8), (BiomeGenBase)null) != BiomeGenBase.deepOcean)
{
return false;
}
boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(i * 16 + 8, j * 16 + 8, 29, field_175802_d);
if (flag)
{
return true;
}
}
return false;
}
示例2: canSpawnAt
import net.minecraft.world.biome.BiomeGenBase; //导入方法依赖的package包/类
public static boolean canSpawnAt(World worldObj, int chunkX, int chunkZ) {
int spacing = 32;
int separation = 5;
int xx = chunkX;
int zz = chunkZ;
if (chunkX < 0)
chunkX -= spacing - 1;
if (chunkZ < 0)
chunkZ -= spacing - 1;
int i1 = chunkX / spacing;
int j1 = chunkZ / spacing;
Random random = worldObj.setRandomSeed(i1, j1, 10387313);
i1 *= spacing;
j1 *= spacing;
i1 += (random.nextInt(spacing - separation) + random.nextInt(spacing - separation)) / 2;
j1 += (random.nextInt(spacing - separation) + random.nextInt(spacing - separation)) / 2;
if (xx == i1 && zz == j1) {
if (worldObj.getWorldChunkManager().getBiomeGenAt(xx * 16 + 8, zz * 16 + 8) != BiomeGenBase.deepOcean)
return false;
if (worldObj.getWorldChunkManager().areBiomesViable(xx * 16 + 8, zz * 16 + 8, 29, validBiomes))
return true;
}
return false;
}