當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityFallingBlock.setHurtEntities方法代碼示例

本文整理匯總了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);
            }
    }
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:19,代碼來源:FallingPlatformHandler.java

示例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);
    }
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:11,代碼來源:BlockChandelier.java

示例3: onStartFalling

import net.minecraft.entity.item.EntityFallingBlock; //導入方法依賴的package包/類
protected void onStartFalling(EntityFallingBlock fallingEntity)
{
    fallingEntity.setHurtEntities(true);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:BlockAnvil.java

示例4: onStartFalling

import net.minecraft.entity.item.EntityFallingBlock; //導入方法依賴的package包/類
@Override
protected void onStartFalling(EntityFallingBlock fallingEntity)
{
	fallingEntity.setHurtEntities(true);
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:6,代碼來源:BlockBoulder.java


注:本文中的net.minecraft.entity.item.EntityFallingBlock.setHurtEntities方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。