當前位置: 首頁>>代碼示例>>Java>>正文


Java BiomeGenBase.deepOcean方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:41,代碼來源:StructureOceanMonument.java

示例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;
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:30,代碼來源:OceanMonument.java


注:本文中的net.minecraft.world.biome.BiomeGenBase.deepOcean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。