本文整理汇总了Java中net.minecraft.block.BlockSilverfish.canContainSilverfish方法的典型用法代码示例。如果您正苦于以下问题:Java BlockSilverfish.canContainSilverfish方法的具体用法?Java BlockSilverfish.canContainSilverfish怎么用?Java BlockSilverfish.canContainSilverfish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.BlockSilverfish
的用法示例。
在下文中一共展示了BlockSilverfish.canContainSilverfish方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startExecuting
import net.minecraft.block.BlockSilverfish; //导入方法依赖的package包/类
public void startExecuting()
{
if (!this.field_179484_c)
{
super.startExecuting();
}
else
{
World world = this.field_179485_a.worldObj;
BlockPos blockpos = (new BlockPos(this.field_179485_a.posX, this.field_179485_a.posY + 0.5D, this.field_179485_a.posZ)).offset(this.facing);
IBlockState iblockstate = world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
world.setBlockState(blockpos, Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
this.field_179485_a.spawnExplosionParticle();
this.field_179485_a.setDead();
}
}
}
示例2: startExecuting
import net.minecraft.block.BlockSilverfish; //导入方法依赖的package包/类
public void startExecuting()
{
if (!this.doMerge)
{
super.startExecuting();
}
else
{
World world = this.entity.world;
BlockPos blockpos = (new BlockPos(this.entity.posX, this.entity.posY + 0.5D, this.entity.posZ)).offset(this.facing);
IBlockState iblockstate = world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
world.setBlockState(blockpos, Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
this.entity.spawnExplosionParticle();
this.entity.setDead();
}
}
}
示例3: startExecuting
import net.minecraft.block.BlockSilverfish; //导入方法依赖的package包/类
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
if (!this.doMerge)
{
super.startExecuting();
}
else
{
World world = this.silverfish.worldObj;
BlockPos blockpos = (new BlockPos(this.silverfish.posX, this.silverfish.posY + 0.5D, this.silverfish.posZ)).offset(this.facing);
IBlockState iblockstate = world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
world.setBlockState(blockpos, Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
this.silverfish.spawnExplosionParticle();
this.silverfish.setDead();
}
}
}
示例4: shouldExecute
import net.minecraft.block.BlockSilverfish; //导入方法依赖的package包/类
public boolean shouldExecute()
{
if (this.field_179485_a.getAttackTarget() != null)
{
return false;
}
else if (!this.field_179485_a.getNavigator().noPath())
{
return false;
}
else
{
Random random = this.field_179485_a.getRNG();
if (random.nextInt(10) == 0)
{
this.facing = EnumFacing.random(random);
BlockPos blockpos = (new BlockPos(this.field_179485_a.posX, this.field_179485_a.posY + 0.5D, this.field_179485_a.posZ)).offset(this.facing);
IBlockState iblockstate = this.field_179485_a.worldObj.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
this.field_179484_c = true;
return true;
}
}
this.field_179484_c = false;
return super.shouldExecute();
}
}
示例5: shouldExecute
import net.minecraft.block.BlockSilverfish; //导入方法依赖的package包/类
public boolean shouldExecute()
{
if (this.entity.getAttackTarget() != null)
{
return false;
}
else if (!this.entity.getNavigator().noPath())
{
return false;
}
else
{
Random random = this.entity.getRNG();
if (this.entity.world.getGameRules().getBoolean("mobGriefing") && random.nextInt(10) == 0)
{
this.facing = EnumFacing.random(random);
BlockPos blockpos = (new BlockPos(this.entity.posX, this.entity.posY + 0.5D, this.entity.posZ)).offset(this.facing);
IBlockState iblockstate = this.entity.world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
this.doMerge = true;
return true;
}
}
this.doMerge = false;
return super.shouldExecute();
}
}
示例6: shouldExecute
import net.minecraft.block.BlockSilverfish; //导入方法依赖的package包/类
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.silverfish.worldObj.getGameRules().getBoolean("mobGriefing"))
{
return false;
}
else if (this.silverfish.getAttackTarget() != null)
{
return false;
}
else if (!this.silverfish.getNavigator().noPath())
{
return false;
}
else
{
Random random = this.silverfish.getRNG();
if (random.nextInt(10) == 0)
{
this.facing = EnumFacing.random(random);
BlockPos blockpos = (new BlockPos(this.silverfish.posX, this.silverfish.posY + 0.5D, this.silverfish.posZ)).offset(this.facing);
IBlockState iblockstate = this.silverfish.worldObj.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
this.doMerge = true;
return true;
}
}
this.doMerge = false;
return super.shouldExecute();
}
}