当前位置: 首页>>代码示例>>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;未经允许,请勿转载。