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


Java EntityWither.setLocationAndAngles方法代碼示例

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


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

示例1: onFinish

import net.minecraft.entity.boss.EntityWither; //導入方法依賴的package包/類
@Override
public void onFinish(EntityPlayer player, IRitualHandler tile, World world, BlockPos pos, NBTTagCompound data) {
	if (!world.isRemote) {
		EntityWither entitywither = new EntityWither(world);
		BlockPos blockpos1 = pos.add(0, 0, 0);
		entitywither.setLocationAndAngles(blockpos1.getX() + 0.5D, blockpos1.getY() + 0.55D, blockpos1.getZ() + 0.5D, 0F, 0F);
		for (EntityPlayerMP entityplayermp : world.getEntitiesWithinAABB(EntityPlayerMP.class, entitywither.getEntityBoundingBox().grow(50.0D))) {
			CriteriaTriggers.SUMMONED_ENTITY.trigger(entityplayermp, entitywither);
		}
		world.spawnEntity(entitywither);
		entitywither.ignite();
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:14,代碼來源:RitualConjurationWither.java

示例2: checkWitherSpawn

import net.minecraft.entity.boss.EntityWither; //導入方法依賴的package包/類
public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te)
{
    if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote)
    {
        BlockPattern blockpattern = this.getWitherPattern();
        BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos);

        if (blockpattern$patternhelper != null)
        {
            for (int i = 0; i < 3; ++i)
            {
                BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0);
                worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2);
            }

            for (int j = 0; j < blockpattern.getPalmLength(); ++j)
            {
                for (int k = 0; k < blockpattern.getThumbLength(); ++k)
                {
                    BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0);
                    worldIn.setBlockState(blockworldstate1.getPos(), Blocks.air.getDefaultState(), 2);
                }
            }

            BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos();
            EntityWither entitywither = new EntityWither(worldIn);
            BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
            entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F);
            entitywither.renderYawOffset = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F;
            entitywither.func_82206_m();

            for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D)))
            {
                entityplayer.triggerAchievement(AchievementList.spawnWither);
            }

            worldIn.spawnEntityInWorld(entitywither);

            for (int l = 0; l < 120; ++l)
            {
                worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
            }

            for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1)
            {
                for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1)
                {
                    BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0);
                    worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
                }
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:55,代碼來源:BlockSkull.java

示例3: checkWitherSpawn

import net.minecraft.entity.boss.EntityWither; //導入方法依賴的package包/類
public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te)
{
    if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote)
    {
        BlockPattern blockpattern = this.getWitherPattern();
        BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos);

        if (blockpattern$patternhelper != null)
        {
            for (int i = 0; i < 3; ++i)
            {
                BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0);
                worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2);
            }

            for (int j = 0; j < blockpattern.getPalmLength(); ++j)
            {
                for (int k = 0; k < blockpattern.getThumbLength(); ++k)
                {
                    BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0);
                    worldIn.setBlockState(blockworldstate1.getPos(), Blocks.AIR.getDefaultState(), 2);
                }
            }

            BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos();
            EntityWither entitywither = new EntityWither(worldIn);
            BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
            entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F);
            entitywither.renderYawOffset = blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F;
            entitywither.ignite();

            for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expandXyz(50.0D)))
            {
                entityplayer.addStat(AchievementList.SPAWN_WITHER);
            }

            worldIn.spawnEntityInWorld(entitywither);

            for (int l = 0; l < 120; ++l)
            {
                worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
            }

            for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1)
            {
                for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1)
                {
                    BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0);
                    worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.AIR, false);
                }
            }
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:55,代碼來源:BlockSkull.java

示例4: checkWitherSpawn

import net.minecraft.entity.boss.EntityWither; //導入方法依賴的package包/類
public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te)
{
    if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote)
    {
        BlockPattern blockpattern = this.getWitherPattern();
        BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos);

        if (blockpattern$patternhelper != null)
        {
            for (int i = 0; i < 3; ++i)
            {
                BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0);
                worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2);
            }

            for (int j = 0; j < blockpattern.getPalmLength(); ++j)
            {
                for (int k = 0; k < blockpattern.getThumbLength(); ++k)
                {
                    BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0);
                    worldIn.setBlockState(blockworldstate1.getPos(), Blocks.AIR.getDefaultState(), 2);
                }
            }

            BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos();
            EntityWither entitywither = new EntityWither(worldIn);
            BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
            entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F);
            entitywither.renderYawOffset = blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F;
            entitywither.ignite();

            for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expandXyz(50.0D)))
            {
                entityplayer.addStat(AchievementList.SPAWN_WITHER);
            }

            worldIn.spawnEntityInWorld(entitywither);

            for (int l = 0; l < 120; ++l)
            {
                worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
            }

            for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1)
            {
                for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1)
                {
                    BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0);
                    worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.AIR);
                }
            }
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:55,代碼來源:BlockSkull.java


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