Search in sources :

Example 51 with Particle

use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.

the class ClientEffects method trailEffect.

public void trailEffect(BlockPos start, TileEntity dest, long colorSeed) {
    if (thinParticles(false))
        return;
    if (mc.player.getDistanceSq(start) > TRACKING_DISTANCE)
        return;
    if (rand.nextInt(3) == 0) {
        double px = start.getX() + 0.5 + rand.nextGaussian() * 0.1;
        double py = start.getY() + 0.5 + rand.nextGaussian() * 0.1;
        double pz = start.getZ() + 0.5 + rand.nextGaussian() * 0.1;
        Particle particle = new ParticleHeatTrail(dest.getWorld(), new Vec3d(px, py, pz), colorSeed, EffectManager.getEffectSource(dest));
        spawnParticle(particle);
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) Vec3d(net.minecraft.util.math.Vec3d)

Example 52 with Particle

use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.

the class ClientEffects method chunkLoaderEffect.

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().player.getDistanceSq(sourcePos.x, sourcePos.y, sourcePos.z) > 25600)
        return;
    for (ChunkPos chunk : chunks) {
        int xCorner = chunk.x * 16;
        int zCorner = chunk.z * 16;
        double yCorner = sourcePos.y - 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 53 with Particle

use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.

the class FluidTools method drip.

@SideOnly(Side.CLIENT)
public static void drip(World world, BlockPos pos, IBlockState state, Random rand, float particleRed, float particleGreen, float particleBlue) {
    if (rand.nextInt(10) == 0 && world.isSideSolid(pos.down(), EnumFacing.UP) && !WorldPlugin.getBlockMaterial(world, pos.down(2)).blocksMovement()) {
        double px = (double) ((float) pos.getX() + rand.nextFloat());
        double py = (double) pos.getY() - 1.05D;
        double pz = (double) ((float) pos.getZ() + rand.nextFloat());
        Particle fx = new ParticleDrip(world, new Vec3d(px, py, pz), particleRed, particleGreen, particleBlue);
        FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx);
    }
}
Also used : Particle(net.minecraft.client.particle.Particle) ParticleDrip(mods.railcraft.client.particles.ParticleDrip) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

Particle (net.minecraft.client.particle.Particle)53 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)22 ParticleManager (net.minecraft.client.particle.ParticleManager)9 Vec3d (net.minecraft.util.math.Vec3d)9 BlockPos (net.minecraft.util.math.BlockPos)8 IEffectSource (mods.railcraft.common.util.effects.EffectManager.IEffectSource)4 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 EnumFacing (net.minecraft.util.EnumFacing)4 World (net.minecraft.world.World)4 Random (java.util.Random)3 Minecraft (net.minecraft.client.Minecraft)3 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)3 IStateParticleBakedModel (pl.asie.charset.lib.render.model.IStateParticleBakedModel)3 TESRSignals (mods.railcraft.client.render.tesr.TESRSignals)2 IBlockState (net.minecraft.block.state.IBlockState)2 ParticleFlame (net.minecraft.client.particle.ParticleFlame)2 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)2 TileEntity (net.minecraft.tileentity.TileEntity)2 ResourceLocation (net.minecraft.util.ResourceLocation)2