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


Java Block.getTickRandomly方法代碼示例

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


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

示例1: removeInvalidBlocks

import net.minecraft.block.Block; //導入方法依賴的package包/類
public void removeInvalidBlocks()
{
    this.blockRefCount = 0;
    this.tickRefCount = 0;

    for (int i = 0; i < 16; ++i)
    {
        for (int j = 0; j < 16; ++j)
        {
            for (int k = 0; k < 16; ++k)
            {
                Block block = this.getBlockByExtId(i, j, k);

                if (block != Blocks.air)
                {
                    ++this.blockRefCount;

                    if (block.getTickRandomly())
                    {
                        ++this.tickRefCount;
                    }
                }
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:27,代碼來源:ExtendedBlockStorage.java

示例2: removeInvalidBlocks

import net.minecraft.block.Block; //導入方法依賴的package包/類
public void removeInvalidBlocks()
{
    this.blockRefCount = 0;
    this.tickRefCount = 0;

    for (int i = 0; i < 16; ++i)
    {
        for (int j = 0; j < 16; ++j)
        {
            for (int k = 0; k < 16; ++k)
            {
                Block block = this.get(i, j, k).getBlock();

                if (block != Blocks.AIR)
                {
                    ++this.blockRefCount;

                    if (block.getTickRandomly())
                    {
                        ++this.tickRefCount;
                    }
                }
            }
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:27,代碼來源:ExtendedBlockStorage.java

示例3: set

import net.minecraft.block.Block; //導入方法依賴的package包/類
public void set(int x, int y, int z, IBlockState state)
{
    IBlockState iblockstate = this.get(x, y, z);
    Block block = iblockstate.getBlock();
    Block block1 = state.getBlock();

    if (block != Blocks.air)
    {
        --this.blockRefCount;

        if (block.getTickRandomly())
        {
            --this.tickRefCount;
        }
    }

    if (block1 != Blocks.air)
    {
        ++this.blockRefCount;

        if (block1.getTickRandomly())
        {
            ++this.tickRefCount;
        }
    }

    this.data[y << 8 | z << 4 | x] = (char)Block.BLOCK_STATE_IDS.get(state);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:29,代碼來源:ExtendedBlockStorage.java

示例4: removeInvalidBlocks

import net.minecraft.block.Block; //導入方法依賴的package包/類
public void removeInvalidBlocks()
{
    IBlockState iblockstate = Blocks.AIR.getDefaultState();
    int i = 0;
    int j = 0;

    for (int k = 0; k < 16; ++k)
    {
        for (int l = 0; l < 16; ++l)
        {
            for (int i1 = 0; i1 < 16; ++i1)
            {
                IBlockState iblockstate1 = this.data.get(i1, k, l);

                if (iblockstate1 != iblockstate)
                {
                    ++i;
                    Block block = iblockstate1.getBlock();

                    if (block.getTickRandomly())
                    {
                        ++j;
                    }
                }
            }
        }
    }

    this.blockRefCount = i;
    this.tickRefCount = j;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:32,代碼來源:ExtendedBlockStorage.java

示例5: set

import net.minecraft.block.Block; //導入方法依賴的package包/類
public void set(int x, int y, int z, IBlockState state)
{
    if (state instanceof net.minecraftforge.common.property.IExtendedBlockState)
        state = ((net.minecraftforge.common.property.IExtendedBlockState) state).getClean();
    IBlockState iblockstate = this.get(x, y, z);
    Block block = iblockstate.getBlock();
    Block block1 = state.getBlock();

    if (block != Blocks.AIR)
    {
        --this.blockRefCount;

        if (block.getTickRandomly())
        {
            --this.tickRefCount;
        }
    }

    if (block1 != Blocks.AIR)
    {
        ++this.blockRefCount;

        if (block1.getTickRandomly())
        {
            ++this.tickRefCount;
        }
    }

    this.data.set(x, y, z, state);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:31,代碼來源:ExtendedBlockStorage.java

示例6: removeInvalidBlocks

import net.minecraft.block.Block; //導入方法依賴的package包/類
public void removeInvalidBlocks()
{
    List list = Block.BLOCK_STATE_IDS.getObjectList();
    int i = list.size();
    int j = 0;
    int k = 0;

    for (int l = 0; l < 16; ++l)
    {
        int i1 = l << 8;

        for (int j1 = 0; j1 < 16; ++j1)
        {
            int k1 = i1 | j1 << 4;

            for (int l1 = 0; l1 < 16; ++l1)
            {
                int i2 = this.data[k1 | l1];

                if (i2 > 0)
                {
                    ++j;

                    if (i2 < i)
                    {
                        IBlockState iblockstate = (IBlockState)list.get(i2);

                        if (iblockstate != null)
                        {
                            Block block = iblockstate.getBlock();

                            if (block.getTickRandomly())
                            {
                                ++k;
                            }
                        }
                    }
                }
            }
        }
    }

    this.blockRefCount = j;
    this.tickRefCount = k;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:46,代碼來源:ExtendedBlockStorage.java


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