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


Java World.newExplosion方法代碼示例

本文整理匯總了Java中net.minecraft.world.World.newExplosion方法的典型用法代碼示例。如果您正苦於以下問題:Java World.newExplosion方法的具體用法?Java World.newExplosion怎麽用?Java World.newExplosion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.world.World的用法示例。


在下文中一共展示了World.newExplosion方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: performEffect

import net.minecraft.world.World; //導入方法依賴的package包/類
@Override
public void performEffect(RayTraceResult rtrace, EntityLivingBase caster, World world) {
	world.newExplosion(caster, rtrace.hitVec.x, rtrace.hitVec.y + 0.5, rtrace.hitVec.z, 0.3f, false, true);
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:5,代碼來源:SpellDestabilization.java

示例2: onBlockActivated

import net.minecraft.world.World; //導入方法依賴的package包/類
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        if (state.getValue(PART) != BlockBed.EnumPartType.HEAD)
        {
            pos = pos.offset((EnumFacing)state.getValue(FACING));
            state = worldIn.getBlockState(pos);

            if (state.getBlock() != this)
            {
                return true;
            }
        }

        if (worldIn.provider.canRespawnHere() && worldIn.getBiomeGenForCoords(pos) != BiomeGenBase.hell)
        {
            if (((Boolean)state.getValue(OCCUPIED)).booleanValue())
            {
                EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos);

                if (entityplayer != null)
                {
                    playerIn.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0]));
                    return true;
                }

                state = state.withProperty(OCCUPIED, Boolean.valueOf(false));
                worldIn.setBlockState(pos, state, 4);
            }

            EntityPlayer.EnumStatus entityplayer$enumstatus = playerIn.trySleep(pos);

            if (entityplayer$enumstatus == EntityPlayer.EnumStatus.OK)
            {
                state = state.withProperty(OCCUPIED, Boolean.valueOf(true));
                worldIn.setBlockState(pos, state, 4);
                return true;
            }
            else
            {
                if (entityplayer$enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW)
                {
                    playerIn.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0]));
                }
                else if (entityplayer$enumstatus == EntityPlayer.EnumStatus.NOT_SAFE)
                {
                    playerIn.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0]));
                }

                return true;
            }
        }
        else
        {
            worldIn.setBlockToAir(pos);
            BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());

            if (worldIn.getBlockState(blockpos).getBlock() == this)
            {
                worldIn.setBlockToAir(blockpos);
            }

            worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true);
            return true;
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:73,代碼來源:BlockBed.java

示例3: vaporize

import net.minecraft.world.World; //導入方法依賴的package包/類
@Override
public void vaporize(EntityPlayer player, World worldIn, BlockPos pos, FluidStack fluidStack) {
	
	worldIn.newExplosion(player, pos.getX(), pos.getY(), pos.getZ(), 1, true, true);
}
 
開發者ID:EnderiumSmith,項目名稱:CharcoalPit,代碼行數:6,代碼來源:FluidCreosote.java

示例4: onBlockActivated

import net.minecraft.world.World; //導入方法依賴的package包/類
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        if (state.getValue(PART) != BlockBed.EnumPartType.HEAD)
        {
            pos = pos.offset((EnumFacing)state.getValue(FACING));
            state = worldIn.getBlockState(pos);

            if (state.getBlock() != this)
            {
                return true;
            }
        }

        if (worldIn.provider.canRespawnHere() && worldIn.getBiome(pos) != Biomes.HELL)
        {
            if (((Boolean)state.getValue(OCCUPIED)).booleanValue())
            {
                EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos);

                if (entityplayer != null)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]), true);
                    return true;
                }

                state = state.withProperty(OCCUPIED, Boolean.valueOf(false));
                worldIn.setBlockState(pos, state, 4);
            }

            EntityPlayer.SleepResult entityplayer$sleepresult = playerIn.trySleep(pos);

            if (entityplayer$sleepresult == EntityPlayer.SleepResult.OK)
            {
                state = state.withProperty(OCCUPIED, Boolean.valueOf(true));
                worldIn.setBlockState(pos, state, 4);
                return true;
            }
            else
            {
                if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_POSSIBLE_NOW)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.noSleep", new Object[0]), true);
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_SAFE)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.notSafe", new Object[0]), true);
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.TOO_FAR_AWAY)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.tooFarAway", new Object[0]), true);
                }

                return true;
            }
        }
        else
        {
            worldIn.setBlockToAir(pos);
            BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());

            if (worldIn.getBlockState(blockpos).getBlock() == this)
            {
                worldIn.setBlockToAir(blockpos);
            }

            worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true);
            return true;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:77,代碼來源:BlockBed.java

示例5: onBlockActivated

import net.minecraft.world.World; //導入方法依賴的package包/類
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        if (state.getValue(PART) != BlockBed.EnumPartType.HEAD)
        {
            pos = pos.offset((EnumFacing)state.getValue(FACING));
            state = worldIn.getBlockState(pos);

            if (state.getBlock() != this)
            {
                return true;
            }
        }

        if (worldIn.provider.canRespawnHere() && worldIn.getBiome(pos) != Biomes.HELL)
        {
            if (((Boolean)state.getValue(OCCUPIED)).booleanValue())
            {
                EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos);

                if (entityplayer != null)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]));
                    return true;
                }

                state = state.withProperty(OCCUPIED, Boolean.valueOf(false));
                worldIn.setBlockState(pos, state, 4);
            }

            EntityPlayer.SleepResult entityplayer$sleepresult = playerIn.trySleep(pos);

            if (entityplayer$sleepresult == EntityPlayer.SleepResult.OK)
            {
                state = state.withProperty(OCCUPIED, Boolean.valueOf(true));
                worldIn.setBlockState(pos, state, 4);
                return true;
            }
            else
            {
                if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_POSSIBLE_NOW)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.noSleep", new Object[0]));
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_SAFE)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.notSafe", new Object[0]));
                }

                return true;
            }
        }
        else
        {
            worldIn.setBlockToAir(pos);
            BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());

            if (worldIn.getBlockState(blockpos).getBlock() == this)
            {
                worldIn.setBlockToAir(blockpos);
            }

            worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true);
            return true;
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:73,代碼來源:BlockBed.java


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