本文整理匯總了Java中net.minecraft.entity.item.EntityFallingBlock.setHurtEntities方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityFallingBlock.setHurtEntities方法的具體用法?Java EntityFallingBlock.setHurtEntities怎麽用?Java EntityFallingBlock.setHurtEntities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.item.EntityFallingBlock
的用法示例。
在下文中一共展示了EntityFallingBlock.setHurtEntities方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: dropPlatform
import net.minecraft.entity.item.EntityFallingBlock; //導入方法依賴的package包/類
private void dropPlatform(World world, BlockPos pos) {
BlockPos anchorpos = pos.down();
IBlockState blockstate = world.getBlockState(anchorpos);
Block block = blockstate.getBlock();
if (!world.isRemote && block == BWMBlocks.ANCHOR && !isAnchorSupported(world, anchorpos)) {
EnumFacing facing = blockstate.getValue(DirUtils.FACING);
HashSet<BlockPos> platformBlocks = new HashSet<>();
boolean success = findPlatformPart(world,anchorpos,platformBlocks);
if(success)
for (BlockPos plat : platformBlocks) {
EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, (double)plat.getX() + 0.5D, (double)plat.getY(), (double)plat.getZ() + 0.5D, world.getBlockState(plat));
entityfallingblock.setHurtEntities(true);
world.spawnEntity(entityfallingblock);
}
}
}
示例2: checkAndDrop
import net.minecraft.entity.item.EntityFallingBlock; //導入方法依賴的package包/類
public void checkAndDrop(World worldIn, BlockPos pos)
{
if (!worldIn.isRemote && !canBlockStay(worldIn, pos) && worldIn.isAreaLoaded(pos.add(-32, -32, -32), pos.add(32, 32, 32)))
{
EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, worldIn.getBlockState(pos));
entityfallingblock.shouldDropItem = true;
entityfallingblock.setHurtEntities(true);
worldIn.spawnEntity(entityfallingblock);
}
}
示例3: onStartFalling
import net.minecraft.entity.item.EntityFallingBlock; //導入方法依賴的package包/類
protected void onStartFalling(EntityFallingBlock fallingEntity)
{
fallingEntity.setHurtEntities(true);
}
示例4: onStartFalling
import net.minecraft.entity.item.EntityFallingBlock; //導入方法依賴的package包/類
@Override
protected void onStartFalling(EntityFallingBlock fallingEntity)
{
fallingEntity.setHurtEntities(true);
}