Search in sources :

Example 1 with ParticleApproachPoint

use of am2.particles.ParticleApproachPoint in project ArsMagica2 by Mithion.

the class EntityFireElemental method onUpdate.

@Override
public void onUpdate() {
    int cookTargetID = dataWatcher.getWatchableObjectInt(19);
    if (cookTargetID != 0) {
        List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(cookRadius, cookRadius, cookRadius));
        EntityItem inanimate = null;
        for (EntityItem item : items) {
            if (item.getEntityId() == cookTargetID) {
                inanimate = item;
            }
        }
        if (inanimate != null && worldObj.isRemote) {
            AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "fire", posX, posY + getEyeHeight(), posZ);
            if (effect != null) {
                effect.setIgnoreMaxAge(true);
                effect.AddParticleController(new ParticleApproachPoint(effect, inanimate.posX + (rand.nextFloat() - 0.5), inanimate.posY + (rand.nextFloat() - 0.5), inanimate.posZ + (rand.nextFloat() - 0.5), 0.1f, 0.1f, 1, false).setKillParticleOnFinish(true));
            }
        }
    }
    if (worldObj.isRemote && rand.nextInt(100) > 75 && !isBurning())
        for (int i = 0; i < AMCore.config.getGFXLevel(); i++) worldObj.spawnParticle("largesmoke", posX + (rand.nextDouble() - 0.5D) * width, posY + rand.nextDouble() * height, posZ + (rand.nextDouble() - 0.5D) * width, 0.0D, 0.0D, 0.0D);
    super.onUpdate();
}
Also used : AMParticle(am2.particles.AMParticle) ParticleApproachPoint(am2.particles.ParticleApproachPoint) ParticleApproachPoint(am2.particles.ParticleApproachPoint) EntityItem(net.minecraft.entity.item.EntityItem)

Example 2 with ParticleApproachPoint

use of am2.particles.ParticleApproachPoint in project ArsMagica2 by Mithion.

the class Telekinesis method spawnParticles.

@Override
public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier) {
    if (caster instanceof EntityPlayer) {
        double range = ExtendedProperties.For(caster).TK_Distance;
        MovingObjectPosition mop = ItemsCommonProxy.spell.getMovingObjectPosition(caster, world, range, false, false);
        if (mop == null) {
            x = caster.posX + (Math.cos(Math.toRadians(caster.rotationYaw + 90)) * range);
            z = caster.posZ + (Math.sin(Math.toRadians(caster.rotationYaw + 90)) * range);
            y = caster.posY + (-Math.sin(Math.toRadians(caster.rotationPitch)) * range);
        }
    }
    AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "arcane", x - 0.5 + rand.nextDouble(), y - 0.5 + rand.nextDouble(), z - 0.5 + rand.nextDouble());
    if (effect != null) {
        effect.AddParticleController(new ParticleApproachPoint(effect, x, y, z, 0.025f, 0.025f, 1, false));
        effect.setRGBColorF(0.8f, 0.3f, 0.7f);
        if (colorModifier > -1) {
            effect.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
        }
    }
}
Also used : MovingObjectPosition(net.minecraft.util.MovingObjectPosition) AMParticle(am2.particles.AMParticle) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ParticleApproachPoint(am2.particles.ParticleApproachPoint)

Example 3 with ParticleApproachPoint

use of am2.particles.ParticleApproachPoint in project ArsMagica2 by Mithion.

the class Attract method spawnParticles.

@Override
public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier) {
    AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "arcane", x, y, z);
    if (effect != null) {
        effect.addRandomOffset(1, 1, 1);
        effect.AddParticleController(new ParticleApproachPoint(effect, x, y, z, 0.025f, 0.025f, 1, false));
        effect.setRGBColorF(0.8f, 0.3f, 0.7f);
        if (colorModifier > -1) {
            effect.setRGBColorF(((colorModifier >> 16) & 0xFF) / 255.0f, ((colorModifier >> 8) & 0xFF) / 255.0f, (colorModifier & 0xFF) / 255.0f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleApproachPoint(am2.particles.ParticleApproachPoint)

Aggregations

AMParticle (am2.particles.AMParticle)3 ParticleApproachPoint (am2.particles.ParticleApproachPoint)3 EntityItem (net.minecraft.entity.item.EntityItem)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 MovingObjectPosition (net.minecraft.util.MovingObjectPosition)1