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


Java World.func_190526_b方法代碼示例

本文整理匯總了Java中net.minecraft.world.World.func_190526_b方法的典型用法代碼示例。如果您正苦於以下問題:Java World.func_190526_b方法的具體用法?Java World.func_190526_b怎麽用?Java World.func_190526_b使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.world.World的用法示例。


在下文中一共展示了World.func_190526_b方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getClosestStrongholdPos

import net.minecraft.world.World; //導入方法依賴的package包/類
public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos, boolean p_180706_3_)
{
    int i = 1000;
    int j = pos.getX() >> 4;
    int k = pos.getZ() >> 4;

    for (int l = 0; l <= 1000; ++l)
    {
        for (int i1 = -l; i1 <= l; ++i1)
        {
            boolean flag = i1 == -l || i1 == l;

            for (int j1 = -l; j1 <= l; ++j1)
            {
                boolean flag1 = j1 == -l || j1 == l;

                if (flag || flag1)
                {
                    int k1 = j + i1;
                    int l1 = k + j1;
                    this.rand.setSeed((long)(k1 ^ l1) ^ worldIn.getSeed());
                    this.rand.nextInt();

                    if (this.canSpawnStructureAtCoords(k1, l1) && (!p_180706_3_ || !worldIn.func_190526_b(k1, l1)))
                    {
                        return new BlockPos((k1 << 4) + 8, 64, (l1 << 4) + 8);
                    }
                }
            }
        }
    }

    return null;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:35,代碼來源:MapGenMineshaft.java

示例2: getClosestStrongholdPos

import net.minecraft.world.World; //導入方法依賴的package包/類
public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos, boolean p_180706_3_)
{
    int i = 1000;
    int j = pos.getX() >> 4;
    int k = pos.getZ() >> 4;

    for (int l = 0; l <= 1000; ++l)
    {
        for (int i1 = -l; i1 <= l; ++i1)
        {
            boolean flag = i1 == -l || i1 == l;

            for (int j1 = -l; j1 <= l; ++j1)
            {
                boolean flag1 = j1 == -l || j1 == l;

                if (flag || flag1)
                {
                    int k1 = j + i1;
                    int l1 = k + j1;

                    if (this.canSpawnStructureAtCoords(k1, l1) && (!p_180706_3_ || !worldIn.func_190526_b(k1, l1)))
                    {
                        return new BlockPos((k1 << 4) + 8, 64, (l1 << 4) + 8);
                    }
                }
            }
        }
    }

    return null;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:33,代碼來源:MapGenNetherBridge.java

示例3: func_191069_a

import net.minecraft.world.World; //導入方法依賴的package包/類
protected static BlockPos func_191069_a(World p_191069_0_, MapGenStructure p_191069_1_, BlockPos p_191069_2_, int p_191069_3_, int p_191069_4_, int p_191069_5_, boolean p_191069_6_, int p_191069_7_, boolean p_191069_8_)
{
    int i = p_191069_2_.getX() >> 4;
    int j = p_191069_2_.getZ() >> 4;
    int k = 0;

    for (Random random = new Random(); k <= p_191069_7_; ++k)
    {
        for (int l = -k; l <= k; ++l)
        {
            boolean flag = l == -k || l == k;

            for (int i1 = -k; i1 <= k; ++i1)
            {
                boolean flag1 = i1 == -k || i1 == k;

                if (flag || flag1)
                {
                    int j1 = i + p_191069_3_ * l;
                    int k1 = j + p_191069_3_ * i1;

                    if (j1 < 0)
                    {
                        j1 -= p_191069_3_ - 1;
                    }

                    if (k1 < 0)
                    {
                        k1 -= p_191069_3_ - 1;
                    }

                    int l1 = j1 / p_191069_3_;
                    int i2 = k1 / p_191069_3_;
                    Random random1 = p_191069_0_.setRandomSeed(l1, i2, p_191069_5_);
                    l1 = l1 * p_191069_3_;
                    i2 = i2 * p_191069_3_;

                    if (p_191069_6_)
                    {
                        l1 = l1 + (random1.nextInt(p_191069_3_ - p_191069_4_) + random1.nextInt(p_191069_3_ - p_191069_4_)) / 2;
                        i2 = i2 + (random1.nextInt(p_191069_3_ - p_191069_4_) + random1.nextInt(p_191069_3_ - p_191069_4_)) / 2;
                    }
                    else
                    {
                        l1 = l1 + random1.nextInt(p_191069_3_ - p_191069_4_);
                        i2 = i2 + random1.nextInt(p_191069_3_ - p_191069_4_);
                    }

                    MapGenBase.func_191068_a(p_191069_0_.getSeed(), random, l1, i2);
                    random.nextInt();

                    if (p_191069_1_.canSpawnStructureAtCoords(l1, i2))
                    {
                        if (!p_191069_8_ || !p_191069_0_.func_190526_b(l1, i2))
                        {
                            return new BlockPos((l1 << 4) + 8, 64, (i2 << 4) + 8);
                        }
                    }
                    else if (k == 0)
                    {
                        break;
                    }
                }
            }

            if (k == 0)
            {
                break;
            }
        }
    }

    return null;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:75,代碼來源:MapGenStructure.java


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