Search in sources :

Example 1 with IEffectSource

use of mods.railcraft.common.util.effects.EffectManager.IEffectSource in project Railcraft by Railcraft.

the class ClientEffectProxy method steamJetEffect.

@Override
public void steamJetEffect(World world, Object source, Vec3d vel) {
    if (thinParticles(true))
        return;
    IEffectSource es = EffectManager.getEffectSource(source);
    vel = vel.addVector(rand.nextGaussian() * 0.02, rand.nextGaussian() * 0.02, rand.nextGaussian() * 0.02);
    ParticleSteam fx = new ParticleSteam(world, es.getPosF(), vel, 1.5F);
    fx.setParticleGravity(0F);
    spawnParticle(fx);
}
Also used : IEffectSource(mods.railcraft.common.util.effects.EffectManager.IEffectSource)

Example 2 with IEffectSource

use of mods.railcraft.common.util.effects.EffectManager.IEffectSource in project Railcraft by Railcraft.

the class ClientEffectProxy method chunkLoaderEffect.

@Override
public void chunkLoaderEffect(World world, Object source, Set<ChunkPos> chunks) {
    if (!isGoggleAuraActive(GoggleAura.WORLDSPIKE))
        return;
    IEffectSource es = EffectManager.getEffectSource(source);
    Vec3d sourcePos = es.getPosF();
    if (FMLClientHandler.instance().getClient().thePlayer.getDistanceSq(sourcePos.xCoord, sourcePos.yCoord, sourcePos.zCoord) > 25600)
        return;
    for (ChunkPos chunk : chunks) {
        int xCorner = chunk.chunkXPos * 16;
        int zCorner = chunk.chunkZPos * 16;
        double yCorner = sourcePos.yCoord - 8;
        //            System.out.println(xCorner + ", " + zCorner);
        if (rand.nextInt(3) == 0) {
            if (thinParticles(false))
                continue;
            double xParticle = xCorner + rand.nextFloat() * 16;
            double yParticle = yCorner + rand.nextFloat() * 16;
            double zParticle = zCorner + rand.nextFloat() * 16;
            Particle particle = new ParticleChunkLoader(world, new Vec3d(xParticle, yParticle, zParticle), es);
            spawnParticle(particle);
        }
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) IEffectSource(mods.railcraft.common.util.effects.EffectManager.IEffectSource) ChunkPos(net.minecraft.util.math.ChunkPos) Vec3d(net.minecraft.util.math.Vec3d)

Example 3 with IEffectSource

use of mods.railcraft.common.util.effects.EffectManager.IEffectSource in project Railcraft by Railcraft.

the class ClientEffectProxy method fireSparkEffect.

@Override
public void fireSparkEffect(World world, Vec3d start, Vec3d end) {
    if (thinParticles(false))
        return;
    IEffectSource es = EffectManager.getEffectSource(start);
    Particle particle = new ParticleFireSpark(world, start, end);
    spawnParticle(particle);
    SoundHelper.playSoundClient(world, es.getPos(), SoundEvents.BLOCK_LAVA_POP, SoundCategory.BLOCKS, .2F + rand.nextFloat() * .2F, .9F + rand.nextFloat() * .15F);
}
Also used : Particle(net.minecraft.client.particle.Particle) IEffectSource(mods.railcraft.common.util.effects.EffectManager.IEffectSource)

Example 4 with IEffectSource

use of mods.railcraft.common.util.effects.EffectManager.IEffectSource in project Railcraft by Railcraft.

the class ClientEffectProxy method zapEffectPoint.

@Override
public void zapEffectPoint(World world, Object source) {
    if (thinParticles(false))
        return;
    IEffectSource es = EffectManager.getEffectSource(source);
    if (Minecraft.getMinecraft().getRenderViewEntity().getDistanceSq(es.getPos()) > 400)
        return;
    Vec3d vel = new Vec3d(rand.nextDouble() - 0.5D, rand.nextDouble() - 0.5D, rand.nextDouble() - 0.5D);
    spawnParticle(new ParticleSpark(world, es.getPosF(), vel));
    SoundHelper.playSoundClient(world, es.getPos(), RailcraftSoundEvents.MECHANICAL_ZAP, SoundCategory.BLOCKS, .2F, 1F);
}
Also used : IEffectSource(mods.railcraft.common.util.effects.EffectManager.IEffectSource) Vec3d(net.minecraft.util.math.Vec3d)

Example 5 with IEffectSource

use of mods.railcraft.common.util.effects.EffectManager.IEffectSource in project Railcraft by Railcraft.

the class ClientEffectProxy method zapEffectDeath.

@Override
public void zapEffectDeath(World world, Object source) {
    if (Game.isHost(world)) {
        super.zapEffectDeath(world, source);
        return;
    }
    if (thinParticles(false))
        return;
    IEffectSource es = EffectManager.getEffectSource(source);
    if (Minecraft.getMinecraft().getRenderViewEntity().getDistanceSq(es.getPos()) > 400)
        return;
    SoundHelper.playSoundClient(world, es.getPos(), RailcraftSoundEvents.MECHANICAL_ZAP, SoundCategory.BLOCKS, 3F, 0.75F);
    for (int i = 0; i < 20; i++) {
        Vec3d vel = new Vec3d(rand.nextDouble() - 0.5D, rand.nextDouble() - 0.5D, rand.nextDouble() - 0.5D);
        spawnParticle(new ParticleSpark(world, es.getPosF(), vel));
    }
}
Also used : IEffectSource(mods.railcraft.common.util.effects.EffectManager.IEffectSource) Vec3d(net.minecraft.util.math.Vec3d)

Aggregations

IEffectSource (mods.railcraft.common.util.effects.EffectManager.IEffectSource)6 Vec3d (net.minecraft.util.math.Vec3d)4 Particle (net.minecraft.client.particle.Particle)2 ChunkPos (net.minecraft.util.math.ChunkPos)1