本文整理匯總了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;
}