当前位置: 首页>>代码示例>>Java>>正文


Java EntityWither.canDestroyBlock方法代码示例

本文整理汇总了Java中net.minecraft.entity.boss.EntityWither.canDestroyBlock方法的典型用法代码示例。如果您正苦于以下问题:Java EntityWither.canDestroyBlock方法的具体用法?Java EntityWither.canDestroyBlock怎么用?Java EntityWither.canDestroyBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.boss.EntityWither的用法示例。


在下文中一共展示了EntityWither.canDestroyBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: breakBlocks

import net.minecraft.entity.boss.EntityWither; //导入方法依赖的package包/类
public boolean breakBlocks(){
	boolean flag = false;
	AxisAlignedBB box=this.getBreakingBB();
	for (int x = MathHelper.floor(box.minX); x <= MathHelper.floor(box.maxX); ++x)
		for (int y = MathHelper.floor(box.minY); y <= MathHelper.floor(box.maxY); ++y)
			for (int z = MathHelper.floor(box.minZ); z <= MathHelper.floor(box.maxZ); ++z) {
				BlockPos blockpos = new BlockPos(x, y, z);
				IBlockState iblockstate = this.world.getBlockState(blockpos);
				Block block = iblockstate.getBlock();

				if (!block.isAir(iblockstate, this.world, blockpos) && !iblockstate.getMaterial().isLiquid()
						&& EntityWither.canDestroyBlock(block)
						&& block.canEntityDestroy(iblockstate, world, blockpos, this))
					flag = this.world.destroyBlock(blockpos, true) || flag;
			}

	if (flag)
		this.world.playEvent((EntityPlayer) null, 1022, new BlockPos(this), 0);
	return flag;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:21,代码来源:EntityTF2Boss.java

示例2: getExplosionResistance

import net.minecraft.entity.boss.EntityWither; //导入方法依赖的package包/类
/**
 * Explosion resistance of a block relative to this entity
 */
public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn)
{
    float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn);
    Block block = blockStateIn.getBlock();

    if (this.isInvulnerable() && EntityWither.canDestroyBlock(block))
    {
        f = Math.min(0.8F, f);
    }

    return f;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:EntityWitherSkull.java


注:本文中的net.minecraft.entity.boss.EntityWither.canDestroyBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。