本文整理匯總了Java中net.minecraft.init.Blocks.monster_egg方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.monster_egg方法的具體用法?Java Blocks.monster_egg怎麽用?Java Blocks.monster_egg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.monster_egg方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateTask
import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public void updateTask()
{
--this.field_179463_b;
if (this.field_179463_b <= 0)
{
World world = this.silverfish.worldObj;
Random random = this.silverfish.getRNG();
BlockPos blockpos = new BlockPos(this.silverfish);
for (int i = 0; i <= 5 && i >= -5; i = i <= 0 ? 1 - i : 0 - i)
{
for (int j = 0; j <= 10 && j >= -10; j = j <= 0 ? 1 - j : 0 - j)
{
for (int k = 0; k <= 10 && k >= -10; k = k <= 0 ? 1 - k : 0 - k)
{
BlockPos blockpos1 = blockpos.add(j, i, k);
IBlockState iblockstate = world.getBlockState(blockpos1);
if (iblockstate.getBlock() == Blocks.monster_egg)
{
if (world.getGameRules().getBoolean("mobGriefing"))
{
world.destroyBlock(blockpos1, true);
}
else
{
world.setBlockState(blockpos1, ((BlockSilverfish.EnumType)iblockstate.getValue(BlockSilverfish.VARIANT)).getModelBlock(), 3);
}
if (random.nextBoolean())
{
return;
}
}
}
}
}
}
}