本文整理汇总了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;
}
}
}
}
}
}
示例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;
}
}
}
}
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}