Search in sources :

Example 21 with ParticleFloatUpward

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

the class BlockInlay method randomDisplayTick.

@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
    int meta = world.getBlockMetadata(x, y, z);
    if (world.isRemote && world.getBlock(x, y - 1, z).isAir(world, x, y, z) && AMCore.config.FullGFX() && rand.nextInt(10) < 4) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, AMCore.config.FullGFX() ? "radiant" : "sparkle2", x + rand.nextFloat(), y, z + rand.nextFloat());
        if (particle != null) {
            particle.setMaxAge(20);
            particle.setParticleScale(AMCore.config.FullGFX() ? 0.015f : 0.15f);
            particle.AddParticleController(new ParticleFloatUpward(particle, 0.01f, -0.025f, 1, false));
            if (this == BlocksCommonProxy.redstoneInlay)
                particle.setRGBColorF(1.0f, 0.4f, 0.4f);
            else if (this == BlocksCommonProxy.ironInlay)
                particle.setRGBColorF(1.0f, 1.0f, 1.0f);
            else if (this == BlocksCommonProxy.goldInlay)
                particle.setRGBColorF(1.0f, 1.0f, 0.2f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 22 with ParticleFloatUpward

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

the class BlockInvisibleUtility method spawnBlockParticles.

private void spawnBlockParticles(World world, int x, int y, int z) {
    AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "symbols", x + 0.5, y + 0.5, z + 0.5);
    if (particle != null) {
        particle.addRandomOffset(1, 1.6, 1);
        particle.setParticleScale(0.1f);
        particle.AddParticleController(new ParticleFloatUpward(particle, 0, 0.02f, 1, false));
        particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.05f));
        particle.setMaxAge(20);
        if (world.rand.nextBoolean()) {
            particle.setRGBColorI(0x481bc8);
        } else {
            particle.setRGBColorI(0x891bc8);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 23 with ParticleFloatUpward

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

the class BlockWitchwoodLeaves method randomDisplayTick.

@Override
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
    if (!AMCore.config.witchwoodLeafPFX())
        return;
    if (par5Random.nextInt(300) == 0 && par1World.isAirBlock(par2, par3 - 1, par4)) {
        AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(par1World, "leaf", par2 + par5Random.nextDouble(), par3 + par5Random.nextDouble(), par4 + par5Random.nextDouble());
        if (particle != null) {
            particle.AddParticleController(new ParticleFloatUpward(particle, 0, -0.05f, 1, false));
            particle.setMaxAge(120);
            particle.noClip = false;
            particle.setParticleScale(0.1f + par5Random.nextFloat() * 0.1f);
            particle.AddParticleController(new ParticlePendulum(particle, 0.2f, 0.15f + par5Random.nextFloat() * 0.2f, 2, false));
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticlePendulum(am2.particles.ParticlePendulum) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Example 24 with ParticleFloatUpward

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

the class VinteumTorch method spawnParticle.

@SideOnly(Side.CLIENT)
private void spawnParticle(World world, double x, double y, double z) {
    AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "light", x, y, z);
    if (effect != null) {
        effect.setMaxAge(3);
        effect.setIgnoreMaxAge(false);
        effect.setRGBColorF(0.69f, 0.89f, 1.0f);
        effect.AddParticleController(new ParticleFloatUpward(effect, 0, 0.01f, 1, false));
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFloatUpward(am2.particles.ParticleFloatUpward) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 25 with ParticleFloatUpward

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

the class EntityNatureGuardian method spawnParticles.

private void spawnParticles() {
    AMParticle leaf = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "leaf", posX + (rand.nextDouble() * 3) - 1.5f, posY + (rand.nextDouble() * 5f), posZ + (rand.nextDouble() * 3) - 1.5f);
    if (leaf != null) {
        leaf.setMaxAge(20);
        leaf.setIgnoreMaxAge(false);
        leaf.AddParticleController(new ParticleFloatUpward(leaf, 0.05f, -0.02f, 1, false));
        if (getCurrentAction() == BossActions.SPINNING) {
            leaf.AddParticleController(new ParticleOrbitEntity(leaf, this, 0.6f, 1, false));
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleOrbitEntity(am2.particles.ParticleOrbitEntity) ParticleFloatUpward(am2.particles.ParticleFloatUpward)

Aggregations

AMParticle (am2.particles.AMParticle)39 ParticleFloatUpward (am2.particles.ParticleFloatUpward)38 ParticleFadeOut (am2.particles.ParticleFadeOut)11 ParticleOrbitEntity (am2.particles.ParticleOrbitEntity)7 AMVector3 (am2.api.math.AMVector3)4 Entity (net.minecraft.entity.Entity)4 EntityLivingBase (net.minecraft.entity.EntityLivingBase)4 TileEntity (net.minecraft.tileentity.TileEntity)4 ParticleOrbitPoint (am2.particles.ParticleOrbitPoint)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 EntityDragonPart (net.minecraft.entity.boss.EntityDragonPart)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)2 ParticleHoldPosition (am2.particles.ParticleHoldPosition)2 ParticleMoveOnHeading (am2.particles.ParticleMoveOnHeading)2 Colour (am2.spell.modifiers.Colour)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Block (net.minecraft.block.Block)2 EntityAnimal (net.minecraft.entity.passive.EntityAnimal)2