Java Code Examples for net.minecraft.entity.projectile.EntityFireball

The following are top voted examples for showing how to use net.minecraft.entity.projectile.EntityFireball. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: MidgarCrusade   File: ServerSpellHandler.java   Source Code and License 6 votes vote down vote up
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);
}
 
Example 2
Project: Aether-Legacy   File: AbilityRepulsion.java   Source Code and License 6 votes vote down vote up
private void setShooter(Entity ent, EntityLivingBase shooter) 
{
	if (ent instanceof EntityArrow)
	{
		((EntityArrow)ent).shootingEntity = shooter;
	}
	else if (ent instanceof EntityFireball)
	{
		((EntityFireball)ent).shootingEntity = shooter;
	}
	else if (ent instanceof EntityFireball)
	{
		((EntityFireball)ent).shootingEntity = shooter;
	}
	else if (ent instanceof EntityDartBase)
	{
		((EntityDartBase)ent).shootingEntity = shooter;
	}
}
 
Example 3
Project: projectzulu1.7.10-pre-1.3a   File: EntityMummyPharaoh.java   Source Code and License 6 votes vote down vote up
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);
    }
}
 
Example 4
Project: ZeldaSwordSkills   File: ItemZeldaShield.java   Source Code and License 6 votes vote down vote up
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
	if (toolMaterial == ToolMaterial.EMERALD) {
		if (player.getHeldItem() != null && ZSSPlayerInfo.get(player).canBlock()) {
			Vec3 vec3 = player.getLookVec();
			double dx = player.posX + vec3.xCoord * 2.0D;
			double dy = player.posY + player.getEyeHeight() + vec3.yCoord * 2.0D;
			double dz = player.posZ + vec3.zCoord * 2.0D;
			List<EntityFireball> list = player.worldObj.getEntitiesWithinAABB(EntityFireball.class, new AxisAlignedBB(dx - 1, dy - 1, dz - 1, dx + 1, dy + 1, dz + 1));
			for (EntityFireball fireball : list) {
				DamageSource source = DamageSource.causeFireballDamage(fireball, fireball.shootingEntity);
				if (canBlockDamage(stack, source) && fireball.attackEntityFrom(DamageSource.causePlayerDamage(player), 1.0F)) {
					fireball.getEntityData().setBoolean("isReflected", true);
					ZSSPlayerInfo.get(player).onAttackBlocked(stack, 1.0F);
					WorldUtils.playSoundAtEntity(player, Sounds.HAMMER, 0.4F, 0.5F);
					break;
				}
			}
		}
	}
}
 
Example 5
Project: projectzulu1.7.10   File: EntityMummyPharaoh.java   Source Code and License 6 votes vote down vote up
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);
    }
}
 
Example 6
Project: Andrew2448PowersuitAddons   File: MobRepulsorModule.java   Source Code and License 6 votes vote down vote up
public void repulse(World world, int i, int j, int k) {
    float distance = 5.0F;
    Entity entity;
    Iterator iterator;
    List list = world.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
    list = world.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
    list = world.getEntitiesWithinAABB(EntityFireball.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
    list = world.getEntitiesWithinAABB(EntityPotion.class, AxisAlignedBB.getBoundingBox(i - distance, j - distance, k - distance, i + distance, j + distance, k + distance));
    for (iterator = list.iterator(); iterator.hasNext(); push(entity, i, j, k)) {
        entity = (Entity)iterator.next();
    }
}
 
Example 7
Project: iChunUtil   File: WorldPortal.java   Source Code and License 6 votes vote down vote up
public void handleSpecialEntities(Entity ent)
{
    if(ent instanceof EntityBlock)
    {
        ((EntityBlock)ent).timeExisting = 2;
    }
    else if(ent instanceof EntityFallingBlock)
    {
        ((EntityFallingBlock)ent).fallTime = 2;
    }
    else if(ent instanceof EntityFireball)
    {
        EntityFireball fireball = (EntityFireball)ent;
        float[] appliedAcceleration = getQuaternionFormula().applyPositionalRotation(new float[] { (float)fireball.accelerationX, (float)fireball.accelerationY, (float)fireball.accelerationZ });
        fireball.accelerationX = appliedAcceleration[0];
        fireball.accelerationY = appliedAcceleration[1];
        fireball.accelerationZ = appliedAcceleration[2];
    }
    else if(ent instanceof EntityArrow)
    {
        ((EntityArrow)ent).inGround = false;
    }
}
 
Example 8
Project: Uranium   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 9
Project: DecompiledMinecraft   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 10
Project: BaseClient   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 11
Project: BaseClient   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 12
Project: MidgarCrusade   File: ServerSpellHandler.java   Source Code and License 5 votes vote down vote up
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);
}
 
Example 13
Project: MidgarCrusade   File: ServerSpellHandler.java   Source Code and License 5 votes vote down vote up
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);
}
 
Example 14
Project: Aether-Legacy   File: AbilityRepulsion.java   Source Code and License 5 votes vote down vote up
private Entity getShooter(Entity ent) 
{
	return ent instanceof EntityArrow ? ((EntityArrow)ent).shootingEntity :
		ent instanceof EntityThrowable ? ((EntityThrowable)ent).getThrower() :
			ent instanceof EntityDartBase ? ((EntityDartBase)ent).shootingEntity :
				ent instanceof EntityFireball ? ((EntityFireball)ent).shootingEntity :
						null;
}
 
Example 15
Project: ThermosRebased   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 16
Project: Thermos   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityFallingBlock // PaperSpigot - Always tick falling blocks
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 17
Project: KCauldron   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 18
Project: CauldronGit   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 19
Project: Cauldron-Old   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 20
Project: Cauldron-Reloaded   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 21
Project: FFoKC   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity.getClass().equals(EntityPlayer.class) && !(entity.getClass().equals(FakePlayer.class))) // Cauldron
            || entity.getClass().equals(EntityThrowable.class)
            || entity.getClass().equals(EntityDragon.class)
            || entity.getClass().equals(EntityDragonPart.class)
            || entity.getClass().equals(EntityWither.class)
            || entity.getClass().equals(EntityFireball.class)
            || entity.getClass().equals(EntityWeatherEffect.class)
            || entity.getClass().equals(EntityTNTPrimed.class)
            || entity.getClass().equals(EntityFallingBlock.class)
            || entity.getClass().equals(EntityEnderCrystal.class)
            || entity.getClass().equals(EntityFireworkRocket.class)
            || entity.getClass().equals(EntityVillager.class)
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 22
Project: Resilience-Client-Source   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
 */
public void doRender(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(par1EntityFireball);
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float var10 = this.field_77002_a;
    GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
    IIcon var11 = Items.fire_charge.getIconFromDamage(0);
    Tessellator var12 = Tessellator.instance;
    float var13 = var11.getMinU();
    float var14 = var11.getMaxU();
    float var15 = var11.getMinV();
    float var16 = var11.getMaxV();
    float var17 = 1.0F;
    float var18 = 0.5F;
    float var19 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    var12.startDrawingQuads();
    var12.setNormal(0.0F, 1.0F, 0.0F);
    var12.addVertexWithUV((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
    var12.addVertexWithUV((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
    var12.addVertexWithUV((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
    var12.addVertexWithUV((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
    var12.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 23
Project: Aura-Cascade   File: ItemMirror.java   Source Code and License 5 votes vote down vote up
/**
 * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
 *
 * @param stack
 * @param world
 * @param player
 */
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){
    AxisAlignedBB axisAlignedBB = new AxisAlignedBB(player.posX - 6, player.posY - 6, player.posZ - 6, player.posX + 6, player.posY + 6, player.posZ + 6);
    ArrayList<EntityFireball> fireballs = (ArrayList<EntityFireball>) world.getEntitiesWithinAABB(EntityFireball.class, axisAlignedBB);
    for (EntityFireball fireball : fireballs) {
        if (fireball.getDistanceSqToEntity(player) <= 25) {
            redirect(fireball);
        }
    }
    AuraCascade.proxy.networkWrapper.sendToAllAround(new PacketBurst(7, player.posX, player.posY, player.posZ), new NetworkRegistry.TargetPoint(player.worldObj.provider.getDimension(), player.posX, player.posY, player.posZ, 32));

    return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
}
 
Example 24
Project: Aura-Cascade   File: ItemMirror.java   Source Code and License 5 votes vote down vote up
public void redirect(EntityFireball entity) {

        if (!entity.worldObj.isRemote && !(entity instanceof EntityWitherSkull)) {
            AxisAlignedBB axisAlignedBB = new AxisAlignedBB(entity.posX - 100, entity.posY - 100, entity.posZ - 100, entity.posX + 100, entity.posY + 100, entity.posZ + 100);


            List<EntityFireball> targets = ImmutableList.copyOf(Iterables.filter(entity.worldObj.getEntitiesWithinAABB(EntityFireball.class, axisAlignedBB), new Predicate<EntityFireball>() {
                @Override
                public boolean apply(EntityFireball input) {
                    return input.shootingEntity instanceof EntityBlaze || input.shootingEntity instanceof EntityGhast;
                }
            }));

            if (targets.size() > 0) {

                //Check to make sure the fireball is traveling towards the player
                Entity target = targets.get(0);
                entity.motionX = (target.posX - entity.posX) / 15;
                entity.motionY = (target.posY - entity.posY) / 15;
                entity.motionZ = (target.posZ - entity.posZ) / 15;
                entity.accelerationX = entity.motionX * .3;
                entity.accelerationY = entity.motionY * .3;
                entity.accelerationZ = entity.motionZ * .3;
                AuraCascade.proxy.networkWrapper.sendToAllAround(new PacketBurst(1, entity.posX, entity.posY, entity.posZ), new NetworkRegistry.TargetPoint(entity.worldObj.provider.getDimension(), entity.posX, entity.posY, entity.posZ, 32));
            }
        }
    }
 
Example 25
Project: Aura-Cascade   File: ItemMirror.java   Source Code and License 5 votes vote down vote up
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
    boolean result = super.onLeftClickEntity(stack, player, entity);
    if (entity instanceof EntityFireball) {
        EntityFireball fireball = (EntityFireball) entity;
        redirect(fireball);
        return true;
    }
    return result;
}
 
Example 26
Project: Cauldron   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
public void doRender(EntityFireball p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(p_76986_1_);
    GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float f2 = this.field_77002_a;
    GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
    IIcon iicon = Items.fire_charge.getIconFromDamage(0);
    Tessellator tessellator = Tessellator.instance;
    float f3 = iicon.getMinU();
    float f4 = iicon.getMaxU();
    float f5 = iicon.getMinV();
    float f6 = iicon.getMaxV();
    float f7 = 1.0F;
    float f8 = 0.5F;
    float f9 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
    tessellator.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 27
Project: Cauldron   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
public void doRender(EntityFireball p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(p_76986_1_);
    GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float f2 = this.field_77002_a;
    GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
    IIcon iicon = Items.fire_charge.getIconFromDamage(0);
    Tessellator tessellator = Tessellator.instance;
    float f3 = iicon.getMinU();
    float f4 = iicon.getMaxU();
    float f5 = iicon.getMinV();
    float f6 = iicon.getMaxV();
    float f7 = 1.0F;
    float f8 = 0.5F;
    float f9 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
    tessellator.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 28
Project: Cauldron   File: ActivationRange.java   Source Code and License 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example 29
Project: projectzulu1.7.10-pre-1.3a   File: EntityMummyPharaoh.java   Source Code and License 5 votes vote down vote up
private void shootFireballAroundTarget() {
    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 desX = targetedEntity.posX + rand.nextInt(10) - 5;
        double desZ = targetedEntity.posZ + rand.nextInt(10) - 5;
        int desY = this.worldObj.getHeightValue((int) desX, (int) desZ);

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

        this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0);
        EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15);
        double var18 = 4.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);
    }
}
 
Example 30
Project: Blockbender   File: Fireball.java   Source Code and License 5 votes vote down vote up
public Fireball(EntityLivingBase entity, int level) {
	super(entity, cooldown + (level * 2000));
	BlockBukkit b = BlockBukkit.getTargetBlock(entity);
	EntityFireball f = new EntityAvatarFireball(entity.worldObj, entity, entity.getLookVec().xCoord, entity.getLookVec().yCoord, entity.getLookVec().zCoord, level + 1);
	entity.worldObj.spawnEntityInWorld(f);
	destroy();
}
 
Example 31
Project: RuneCraftery   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
public void func_77001_a(EntityFireball p_77001_1_, double p_77001_2_, double p_77001_4_, double p_77001_6_, float p_77001_8_, float p_77001_9_) {
   GL11.glPushMatrix();
   this.func_110777_b(p_77001_1_);
   GL11.glTranslatef((float)p_77001_2_, (float)p_77001_4_, (float)p_77001_6_);
   GL11.glEnable('\u803a');
   float var10 = this.field_77002_a;
   GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
   Icon var11 = Item.field_77811_bE.func_77617_a(0);
   Tessellator var12 = Tessellator.field_78398_a;
   float var13 = var11.func_94209_e();
   float var14 = var11.func_94212_f();
   float var15 = var11.func_94206_g();
   float var16 = var11.func_94210_h();
   float var17 = 1.0F;
   float var18 = 0.5F;
   float var19 = 0.25F;
   GL11.glRotatef(180.0F - this.field_76990_c.field_78735_i, 0.0F, 1.0F, 0.0F);
   GL11.glRotatef(-this.field_76990_c.field_78732_j, 1.0F, 0.0F, 0.0F);
   var12.func_78382_b();
   var12.func_78375_b(0.0F, 1.0F, 0.0F);
   var12.func_78374_a((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
   var12.func_78374_a((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
   var12.func_78374_a((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
   var12.func_78374_a((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
   var12.func_78381_a();
   GL11.glDisable('\u803a');
   GL11.glPopMatrix();
}
 
Example 32
Project: RuneCraftery   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
public void doRenderFireball(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(par1EntityFireball);
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float f2 = this.field_77002_a;
    GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
    Icon icon = Item.fireballCharge.getIconFromDamage(0);
    Tessellator tessellator = Tessellator.instance;
    float f3 = icon.getMinU();
    float f4 = icon.getMaxU();
    float f5 = icon.getMinV();
    float f6 = icon.getMaxV();
    float f7 = 1.0F;
    float f8 = 0.5F;
    float f9 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
    tessellator.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 33
Project: MyEssentials-Core   File: EntityUtils.java   Source Code and License 5 votes vote down vote up
private static String getEntityTypeNonCache(Entity e) {
	if (e instanceof EntityGolem) {
        return "Golem";
    } else if (e instanceof IBossDisplayData) {
    	return "Boss";
    } else if (e instanceof IAnimals) {
    	return "Animal";
    } else if (e instanceof IMob) {
    	return "Monster";
    } else if (e instanceof IProjectile) {
    	return "Projectile";
    } else if (e instanceof INpc) {
    	return "NPC";
    } else if (e instanceof EntityItem) {
    	return "Item";
    } else if (e instanceof EntityMob) {
    	return "Monster";
    } else if (e instanceof EntityPlayer) {
    	return "Player";
    } else if (e instanceof EntityFireball) {
    	return "Projectile";
    } else if (e instanceof EntityTNTPrimed) {
    	return "TNT";
    } else {
    	return "Unknown"; // e.getClass().getName();
    }
}
 
Example 34
Project: MyEssentials-Core   File: ProjectileImpactEvent.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a new event for an impacting EntityFireball
 */
public ProjectileImpactEvent(EntityFireball fireball, MovingObjectPosition mop)
{
    super(fireball);
    this.firingEntity = fireball.shootingEntity;
    this.movingObjectPosition = mop;
}
 
Example 35
Project: IceAndShadow2   File: NyxEventHandlerCold.java   Source Code and License 5 votes vote down vote up
@SubscribeEvent
public void onFireball(EntityJoinWorldEvent e) {
	if (e.entity == null)
		return;

	if (e.entity.dimension == IaSFlags.dim_nyx_id) {
		if (e.entity instanceof EntitySmallFireball || e.entity instanceof EntityFireball
				|| e.entity instanceof EntityLargeFireball) {
			e.setCanceled(true);
		}
		e.entity.extinguish();
	}
}
 
Example 36
Project: projectzulu1.7.10   File: EntityMummyPharaoh.java   Source Code and License 5 votes vote down vote up
private void shootFireballAroundTarget() {
    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 desX = targetedEntity.posX + rand.nextInt(10) - 5;
        double desZ = targetedEntity.posZ + rand.nextInt(10) - 5;
        int desY = this.worldObj.getHeightValue((int) desX, (int) desZ);

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

        this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0);
        EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15);
        double var18 = 4.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);
    }
}
 
Example 37
Project: BetterNutritionMod   File: RenderFireball.java   Source Code and License 5 votes vote down vote up
public void doRenderFireball(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(par1EntityFireball);
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float f2 = this.field_77002_a;
    GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
    Icon icon = Item.fireballCharge.getIconFromDamage(0);
    Tessellator tessellator = Tessellator.instance;
    float f3 = icon.getMinU();
    float f4 = icon.getMaxU();
    float f5 = icon.getMinV();
    float f6 = icon.getMaxV();
    float f7 = 1.0F;
    float f8 = 0.5F;
    float f9 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
    tessellator.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
Example 38
Project: Uranium   File: CraftFireball.java   Source Code and License 4 votes vote down vote up
public CraftFireball(CraftServer server, EntityFireball entity) {
    super(server, entity);
}
 
Example 39
Project: Uranium   File: CraftFireball.java   Source Code and License 4 votes vote down vote up
@Override
public EntityFireball getHandle() {
    return (EntityFireball) entity;
}
 
Example 40
Project: DecompiledMinecraft   File: DamageSource.java   Source Code and License 4 votes vote down vote up
/**
 * returns EntityDamageSourceIndirect of a fireball
 */
public static DamageSource causeFireballDamage(EntityFireball fireball, Entity p_76362_1_)
{
    return p_76362_1_ == null ? (new EntityDamageSourceIndirect("onFire", fireball, fireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", fireball, p_76362_1_)).setFireDamage().setProjectile();
}