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


Java EntityLargeFireball类代码示例

本文整理汇总了Java中net.minecraft.entity.projectile.EntityLargeFireball的典型用法代码示例。如果您正苦于以下问题:Java EntityLargeFireball类的具体用法?Java EntityLargeFireball怎么用?Java EntityLargeFireball使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onClickAir

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
@Override
public void onClickAir(PossessivePlayer possessivePlayer, EntityPlayer player) {
    EntityGhast possessing = (EntityGhast) possessivePlayer.getPossessing();
    if (!player.worldObj.isRemote && this.getData(player).getShort("ProjectileCooldown") <= 0) {
        player.worldObj.playEvent(null, 1018, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ), 0);
        float pitchVelocity = MathHelper.cos(player.rotationPitch * 0.017453292F);
        float velocityX = -MathHelper.sin(player.rotationYaw * 0.017453292F) * pitchVelocity;
        float velocityY = -MathHelper.sin(player.rotationPitch * 0.017453292F);
        float velocityZ = MathHelper.cos(player.rotationYaw * 0.017453292F) * pitchVelocity;
        EntityLargeFireball fireball = new EntityLargeFireball(player.worldObj, player, velocityX + player.motionX, velocityY + player.motionY, velocityZ + player.motionZ);
        fireball.posY = player.posY + player.height / 2.0F + 0.5D;
        player.worldObj.spawnEntityInWorld(fireball);
        this.getData(player).setShort("ProjectileCooldown", (short) 20);
        possessing.setAttacking(true);
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:17,代码来源:GhastHandler.java

示例2: handle_auroblast

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_auroblast(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
    EntityFireball fireball2 = new EntityLargeFireball(world, sender.posX + a + 4, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball2);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
    EntityFireball fireball3 = new EntityLargeFireball(world, sender.posX - a - 4, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball3);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:23,代码来源:ServerSpellHandler.java

示例3: onItemRightClick

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
	itemstack.damageItem(10, entityplayer);
		if (!world.isRemote)
		{
				
			Vec3 look = entityplayer.getLookVec();
			EntityLargeFireball fireball2 = new EntityLargeFireball(world, entityplayer, 1, 1, 1);
			fireball2.setPosition(
					entityplayer.posX + look.xCoord * 5,
					entityplayer.posY + look.yCoord * 5,
					entityplayer.posZ + look.zCoord * 5);
			fireball2.accelerationX = look.xCoord * 0.1;
			fireball2.accelerationY = look.yCoord * 0.1;
			fireball2.accelerationZ = look.zCoord * 0.1;
			world.spawnEntityInWorld(fireball2);
			world.playSoundAtEntity(entityplayer, "epicproportionsmod:pat_staff_thunder", 1.0F, 1.0F);
			this.setItemDamage(itemPatStaff.getItemDamage() - 1);
				
		}
		
		return itemstack;
		}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:24,代码来源:itemPatStaff.java

示例4: shootFireballAtTarget

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
private void shootFireballAtTarget() {
    EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D);
    if (targetedEntity != null) {
        int holdRand = rand.nextInt(10) - 5;
        double sourcePositionX = this.posX + holdRand;
        double sourcePositionY = this.posY + 20;
        holdRand = rand.nextInt(10) - 5;
        double sourcePositionZ = this.posZ + holdRand;

        double var11 = targetedEntity.posX - sourcePositionX;
        double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F
                - (sourcePositionY + this.height / 2.0F);
        double var15 = targetedEntity.posZ - sourcePositionZ;
        this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI;

        this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY,
                (int) this.posZ, 0);
        EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15);
        double var18 = 1.0D;
        Vec3 var20 = this.getLook(1.0F);
        var17.posX = sourcePositionX + var20.xCoord * var18;
        var17.posY = sourcePositionY + this.height / 2.0F + 0.5D;
        var17.posZ = sourcePositionZ + var20.zCoord * var18;
        this.worldObj.spawnEntityInWorld(var17);
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:27,代码来源:EntityMummyPharaoh.java

示例5: updateTask

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
/**
 * Updates the task
 */
public void updateTask()
{
    EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
    if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase))
    {
        World world = this.parentEntity.worldObj;
        ++this.attackTimer;

        if (this.attackTimer == 10)
        {
            world.playEvent((EntityPlayer)null, 1015, new BlockPos(this.parentEntity), 0);
        }

        if (this.attackTimer == 20)
        {
            Vec3d vec3d = this.parentEntity.getLook(1.0F);
            double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.xCoord * 4.0D);
            double d3 = entitylivingbase.getEntityBoundingBox().minY + (double)(entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F));
            double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.zCoord * 4.0D);
            world.playEvent((EntityPlayer)null, 1016, new BlockPos(this.parentEntity), 0);
            EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4);
            entitylargefireball.explosionPower = this.parentEntity.getFireballStrength();
            entitylargefireball.posX = this.parentEntity.posX + vec3d.xCoord * 4.0D;
            entitylargefireball.posY = this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F) + 0.5D;
            entitylargefireball.posZ = this.parentEntity.posZ + vec3d.zCoord * 4.0D;
            world.spawnEntityInWorld(entitylargefireball);
            this.attackTimer = -40;
        }
    }
    else if (this.attackTimer > 0)
    {
        --this.attackTimer;
    }

    this.parentEntity.setAttacking(this.attackTimer > 10);
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:40,代码来源:EntityDummy.java

示例6: FireBall

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static Object FireBall(Object... args) {

        ScriptExecutor executor = (ScriptExecutor)args[0];

        Vec3d look = (Vec3d)executor.resolveInput((short)1);
        Double speed = (Double)executor.resolveInput((short)2);
        Vec3d initPos = (Vec3d)executor.resolveInput((short)3);
        Vec3d initPosRel = (Vec3d)executor.resolveInput((short)4);

        if (look == null) {
            look = executor.player.getLookVec();
        }
        if (speed == null) {
            speed = 0.1;
        }
        if (initPos == null) {
            if(initPosRel==null)
                initPos = executor.player.getPositionEyes(1.0F).add(executor.player.getLookVec().scale(2));
            else
                initPos = initPosRel.add(executor.player.getPositionVector());
        }

        look = look.scale(speed);

        EntityLargeFireball fireball = new EntityLargeSettableFireball(executor.player.worldObj, initPos.xCoord,
                                                                        initPos.yCoord, initPos.zCoord,
                                                                        look.xCoord, look.yCoord,
                                                                        look.zCoord);

        executor.player.worldObj.spawnEntityInWorld(fireball);

        executor.resolveOutput((short)5, true);
        return true;
    }
 
开发者ID:Drazuam,项目名称:RunicArcana,代码行数:35,代码来源:DustSymbolFireball.java

示例7: updateTask

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public void updateTask()
{
    EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
    double d0 = 64.0D;

    if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < d0 * d0 && this.parentEntity.canEntityBeSeen(entitylivingbase))
    {
        World world = this.parentEntity.worldObj;
        ++this.attackTimer;

        if (this.attackTimer == 10)
        {
            world.playAuxSFXAtEntity((EntityPlayer)null, 1007, new BlockPos(this.parentEntity), 0);
        }

        if (this.attackTimer == 20)
        {
            double d1 = 4.0D;
            Vec3 vec3 = this.parentEntity.getLook(1.0F);
            double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3.xCoord * d1);
            double d3 = entitylivingbase.getEntityBoundingBox().minY + (double)(entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F));
            double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3.zCoord * d1);
            world.playAuxSFXAtEntity((EntityPlayer)null, 1008, new BlockPos(this.parentEntity), 0);
            EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4);
            entitylargefireball.explosionPower = this.parentEntity.getFireballStrength();
            entitylargefireball.posX = this.parentEntity.posX + vec3.xCoord * d1;
            entitylargefireball.posY = this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F) + 0.5D;
            entitylargefireball.posZ = this.parentEntity.posZ + vec3.zCoord * d1;
            world.spawnEntityInWorld(entitylargefireball);
            this.attackTimer = -40;
        }
    }
    else if (this.attackTimer > 0)
    {
        --this.attackTimer;
    }

    this.parentEntity.setAttacking(this.attackTimer > 10);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:EntityGhast.java

示例8: updateTask

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public void updateTask()
{
    EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
    double d0 = 64.0D;

    if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase))
    {
        World world = this.parentEntity.world;
        ++this.attackTimer;

        if (this.attackTimer == 10)
        {
            world.playEvent((EntityPlayer)null, 1015, new BlockPos(this.parentEntity), 0);
        }

        if (this.attackTimer == 20)
        {
            double d1 = 4.0D;
            Vec3d vec3d = this.parentEntity.getLook(1.0F);
            double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.xCoord * 4.0D);
            double d3 = entitylivingbase.getEntityBoundingBox().minY + (double)(entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F));
            double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.zCoord * 4.0D);
            world.playEvent((EntityPlayer)null, 1016, new BlockPos(this.parentEntity), 0);
            EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4);
            entitylargefireball.explosionPower = this.parentEntity.getFireballStrength();
            entitylargefireball.posX = this.parentEntity.posX + vec3d.xCoord * 4.0D;
            entitylargefireball.posY = this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F) + 0.5D;
            entitylargefireball.posZ = this.parentEntity.posZ + vec3d.zCoord * 4.0D;
            world.spawnEntityInWorld(entitylargefireball);
            this.attackTimer = -40;
        }
    }
    else if (this.attackTimer > 0)
    {
        --this.attackTimer;
    }

    this.parentEntity.setAttacking(this.attackTimer > 10);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:EntityGhast.java

示例9: updateTask

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
/**
 * Updates the task
 */
public void updateTask()
{
    EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget();
    double d0 = 64.0D;

    if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < 4096.0D && this.parentEntity.canEntityBeSeen(entitylivingbase))
    {
        World world = this.parentEntity.worldObj;
        ++this.attackTimer;

        if (this.attackTimer == 10)
        {
            world.playEvent((EntityPlayer)null, 1015, new BlockPos(this.parentEntity), 0);
        }

        if (this.attackTimer == 20)
        {
            double d1 = 4.0D;
            Vec3d vec3d = this.parentEntity.getLook(1.0F);
            double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3d.xCoord * 4.0D);
            double d3 = entitylivingbase.getEntityBoundingBox().minY + (double)(entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F));
            double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3d.zCoord * 4.0D);
            world.playEvent((EntityPlayer)null, 1016, new BlockPos(this.parentEntity), 0);
            EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4);
            entitylargefireball.explosionPower = this.parentEntity.getFireballStrength();
            entitylargefireball.posX = this.parentEntity.posX + vec3d.xCoord * 4.0D;
            entitylargefireball.posY = this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F) + 0.5D;
            entitylargefireball.posZ = this.parentEntity.posZ + vec3d.zCoord * 4.0D;
            world.spawnEntityInWorld(entitylargefireball);
            this.attackTimer = -40;
        }
    }
    else if (this.attackTimer > 0)
    {
        --this.attackTimer;
    }

    this.parentEntity.setAttacking(this.attackTimer > 10);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:43,代码来源:EntityGhast.java

示例10: handle_fireball

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_fireball(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
   	EntityLargeFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
       fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
       world.spawnEntityInWorld(fireball);
       fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例11: handle_windslash

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_windslash(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
   	EntityLargeFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
       fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
       world.spawnEntityInWorld(fireball);
       fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例12: handle_holyblade

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_holyblade(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例13: handle_airrender

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_airrender(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java

示例14: handle_backdraft

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_backdraft(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityLargeFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
    sender.addPotionEffect(new PotionEffect(Potion.harm.id, 1, 1));
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:16,代码来源:ServerSpellHandler.java

示例15: handle_fire

import net.minecraft.entity.projectile.EntityLargeFireball; //导入依赖的package包/类
public static void handle_fire(World world, EntityPlayerMP sender)
{
	float a;
	float b;
	float c;
	
	a = (float) sender.getLookVec().xCoord;
	b = (float) sender.getLookVec().yCoord;
	c = (float) sender.getLookVec().zCoord;
	EntityLargeFireball fireball = new EntityLargeFireball(world, sender.posX + a, sender.posY + b, sender.posZ + c, a, b, c);
    fireball.posY = sender.posY + (double)(sender.height / 2.0F) + 0.5D;
    world.spawnEntityInWorld(fireball);
    fireball.setVelocity(fireball.motionX * 1.5f, fireball.motionY, fireball.motionZ * 1.5f);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:15,代码来源:ServerSpellHandler.java


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