Program: 81808
Project: 81808
Buggy source:
public void profileSurroundings(){
  Minecraft mc=FMLClientHandler.instance().getClient();
  World worldRef=lastWorldDetected;
  EntityPlayer player=FMLClientHandler.instance().getClient().player;
  WeatherManagerClient manager=ClientTickHandler.weatherManager;
  if (worldRef == null || player == null || manager == null || manager.windMan == null) {
    try {
      Thread.sleep(1000L);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
    return;
  }
  if (threadLastWorldTickTime == worldRef.getTotalWorldTime()) {
    return;
  }
  threadLastWorldTickTime=worldRef.getTotalWorldTime();
  Random rand=new Random();
  int size=40;
  int hsize=size / 2;
  int curX=(int)player.posX;
  int curY=(int)player.posY;
  int curZ=(int)player.posZ;
  float windStr=manager.windMan.getWindSpeedForPriority();
  if ((!ConfigParticle.Wind_Particle_leafs && !ConfigParticle.Wind_Particle_air && !ConfigParticle.Wind_Particle_sand&& !ConfigParticle.Wind_Particle_waterfall)) {
    return;
  }
  int spawnRate=(int)(30 / (windStr + 0.001));
  float lastBlockCount=lastTickFoundBlocks;
  float particleCreationRate=(float)ConfigParticle.Wind_Particle_effect_rate;
  float maxScaleSample=15000;
  if (lastBlockCount > maxScaleSample)   lastBlockCount=maxScaleSample - 1;
  float scaleRate=(maxScaleSample - lastBlockCount) / maxScaleSample;
  spawnRate=(int)((spawnRate / (scaleRate + 0.001F)) / (particleCreationRate + 0.001F));
  int BlockCountRate=(int)(((300 / scaleRate + 0.001F)) / (particleCreationRate + 0.001F));
  spawnRate*=(mc.gameSettings.particleSetting + 1);
  BlockCountRate*=(mc.gameSettings.particleSetting + 1);
  spawnRate/=2;
  if (spawnRate < 40) {
    spawnRate=40;
  }
  if (BlockCountRate < 80)   BlockCountRate=80;
  if (BlockCountRate > 5000)   BlockCountRate=5000;
  lastTickFoundBlocks=0;
  double particleAmp=1F;
  if (RotatingParticleManager.useShaders && ConfigCoroAI.particleShaders) {
    particleAmp=ConfigMisc.shaderParticleRateAmplifier * 2D;
  }
 else {
  }
  spawnRate=(int)((double)spawnRate / particleAmp);
  for (int xx=curX - hsize; xx < curX + hsize; xx++) {
    for (int yy=curY - (hsize / 2); yy < curY + hsize; yy++) {
      for (int zz=curZ - hsize; zz < curZ + hsize; zz++) {
        Block block=getBlock(worldRef,xx,yy,zz);
        if (block != null && (block.getMaterial(block.getDefaultState()) == Material.LEAVES || block.getMaterial(block.getDefaultState()) == Material.VINE)) {
          lastTickFoundBlocks++;
          if (worldRef.rand.nextInt(spawnRate) == 0) {
            if (ConfigParticle.Wind_Particle_leafs && (CoroUtilBlock.isAir(getBlock(worldRef,xx,yy - 1,zz)))) {
              EntityRotFX var31=new ParticleTexLeafColor(worldRef,(double)xx,(double)yy,(double)zz,0D,0D,0D,ParticleRegistry.leaf);
              var31.setGravity(0.05F);
              var31.setCanCollide(true);
              var31.killWhenUnderCameraAtLeast=20;
              var31.killWhenFarFromCameraAtLeast=20;
              var31.rotationYaw=rand.nextInt(360);
              var31.rotationPitch=rand.nextInt(360);
              spawnQueue.add(var31);
            }
 else {
            }
          }
        }
 else         if (ConfigParticle.Wind_Particle_waterfall && player.getDistance(xx,yy,zz) < 16 && (block != null && block.getMaterial(block.getDefaultState()) == Material.WATER)) {
          int meta=getBlockMetadata(worldRef,xx,yy,zz);
          if ((meta & 8) != 0) {
            lastTickFoundBlocks+=70;
            int chance=(int)(1 + (((float)BlockCountRate) / 120F));
            Block block2=getBlock(worldRef,xx,yy - 1,zz);
            int meta2=getBlockMetadata(worldRef,xx,yy - 1,zz);
            Block block3=getBlock(worldRef,xx,yy + 10,zz);
            if ((((block2 == null || block2.getMaterial(block2.getDefaultState()) != Material.WATER) || (meta2 & 8) == 0) && (block3 != null && block3.getMaterial(block3.getDefaultState()) == Material.WATER)) || worldRef.rand.nextInt(chance) == 0) {
              float range=0.5F;
              EntityRotFX waterP;
              waterP=new EntityWaterfallFX(worldRef,(double)xx + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)yy + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)zz + 0.5F + ((rand.nextFloat() * range) - (range / 2)),0D,0D,0D,6D,2);
              if (((block2 == null || block2.getMaterial(block2.getDefaultState()) != Material.WATER) || (meta2 & 8) == 0) && (block3 != null && block3.getMaterial(block3.getDefaultState()) == Material.WATER)) {
                range=2F;
                float speed=0.2F;
                for (int i=0; i < 10; i++) {
                  if (worldRef.rand.nextInt(chance / 2) == 0) {
                    waterP=new EntityWaterfallFX(worldRef,(double)xx + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)yy + 0.7F + ((rand.nextFloat() * range) - (range / 2)),(double)zz + 0.5F + ((rand.nextFloat() * range) - (range / 2)),((rand.nextFloat() * speed) - (speed / 2)),((rand.nextFloat() * speed) - (speed / 2)),((rand.nextFloat() * speed) - (speed / 2)),2D,3);
                    waterP.setMotionY(4.5F);
                    spawnQueueNormal.add(waterP);
                  }
                }
              }
 else {
                waterP=new EntityWaterfallFX(worldRef,(double)xx + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)yy + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)zz + 0.5F + ((rand.nextFloat() * range) - (range / 2)),0D,0D,0D,6D,2);
                waterP.setMotionY(0.5F);
                spawnQueueNormal.add(waterP);
              }
            }
          }
        }
 else         if (ConfigParticle.Wind_Particle_fire && (block != null && block == Blocks.FIRE)) {
          lastTickFoundBlocks++;
          if (worldRef.rand.nextInt(Math.max(1,(spawnRate / 100))) == 0) {
            double speed=0.15D;
            EntityRotFX entityfx=pm.spawnNewParticleIconFX(worldRef,ParticleRegistry.smoke,xx + rand.nextDouble(),yy + 0.2D + rand.nextDouble() * 0.2D,zz + rand.nextDouble(),(rand.nextDouble() - rand.nextDouble()) * speed,0.03D,(rand.nextDouble() - rand.nextDouble()) * speed);
            ParticleBehaviors.setParticleRandoms(entityfx,true,true);
            ParticleBehaviors.setParticleFire(entityfx);
            entityfx.setMaxAge(100 + rand.nextInt(300));
            spawnQueueNormal.add(entityfx);
          }
        }
 else         if (false && CoroUtilBlock.isAir(block)) {
          float temp=worldRef.getBiome(new BlockPos(xx,0,zz)).getFloatTemperature(new BlockPos(xx,yy,zz));
        }
      }
    }
  }
}

Fixed version (ground truth):
public void profileSurroundings(){
  Minecraft mc=FMLClientHandler.instance().getClient();
  World worldRef=lastWorldDetected;
  EntityPlayer player=FMLClientHandler.instance().getClient().player;
  WeatherManagerClient manager=ClientTickHandler.weatherManager;
  if (worldRef == null || player == null || manager == null || manager.windMan == null) {
    try {
      Thread.sleep(1000L);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
    return;
  }
  if (threadLastWorldTickTime == worldRef.getTotalWorldTime()) {
    return;
  }
  threadLastWorldTickTime=worldRef.getTotalWorldTime();
  Random rand=new Random();
  int size=40;
  int hsize=size / 2;
  int curX=(int)player.posX;
  int curY=(int)player.posY;
  int curZ=(int)player.posZ;
  float windStr=manager.windMan.getWindSpeedForPriority();
  if ((!ConfigParticle.Wind_Particle_leafs && !ConfigParticle.Wind_Particle_air && !ConfigParticle.Wind_Particle_sand&& !ConfigParticle.Wind_Particle_waterfall)) {
    return;
  }
  int spawnRate=(int)(30 / (windStr + 0.001));
  float lastBlockCount=lastTickFoundBlocks;
  float particleCreationRate=(float)ConfigParticle.Wind_Particle_effect_rate;
  float maxScaleSample=15000;
  if (lastBlockCount > maxScaleSample)   lastBlockCount=maxScaleSample - 1;
  float scaleRate=(maxScaleSample - lastBlockCount) / maxScaleSample;
  spawnRate=(int)((spawnRate / (scaleRate + 0.001F)) / (particleCreationRate + 0.001F));
  int BlockCountRate=(int)(((300 / scaleRate + 0.001F)) / (particleCreationRate + 0.001F));
  spawnRate*=(mc.gameSettings.particleSetting + 1);
  BlockCountRate*=(mc.gameSettings.particleSetting + 1);
  spawnRate/=2;
  if (spawnRate < 40) {
    spawnRate=40;
  }
  if (BlockCountRate < 80)   BlockCountRate=80;
  if (BlockCountRate > 5000)   BlockCountRate=5000;
  lastTickFoundBlocks=0;
  double particleAmp=1F;
  if (RotatingParticleManager.useShaders && ConfigCoroAI.particleShaders) {
    particleAmp=ConfigMisc.shaderParticleRateAmplifier * 2D;
  }
 else {
  }
  spawnRate=(int)((double)spawnRate / particleAmp);
  for (int xx=curX - hsize; xx < curX + hsize; xx++) {
    for (int yy=curY - (hsize / 2); yy < curY + hsize; yy++) {
      for (int zz=curZ - hsize; zz < curZ + hsize; zz++) {
        Block block=getBlock(worldRef,xx,yy,zz);
        if (block != null && (block.getMaterial(block.getDefaultState()) == Material.LEAVES || block.getMaterial(block.getDefaultState()) == Material.VINE)) {
          lastTickFoundBlocks++;
          if (worldRef.rand.nextInt(spawnRate) == 0) {
            if (ConfigParticle.Wind_Particle_leafs && (CoroUtilBlock.isAir(getBlock(worldRef,xx,yy - 1,zz)))) {
              EntityRotFX var31=new ParticleTexLeafColor(worldRef,(double)xx,(double)yy,(double)zz,0D,0D,0D,ParticleRegistry.leaf);
              var31.setGravity(0.05F);
              var31.setCanCollide(true);
              var31.killWhenUnderCameraAtLeast=20;
              var31.killWhenFarFromCameraAtLeast=20;
              var31.rotationYaw=rand.nextInt(360);
              var31.rotationPitch=rand.nextInt(360);
              spawnQueue.add(var31);
            }
 else {
            }
          }
        }
 else         if (ConfigParticle.Wind_Particle_waterfall && player.getDistance(xx,yy,zz) < 16 && (block != null && block.getMaterial(block.getDefaultState()) == Material.WATER)) {
          int meta=getBlockMetadata(worldRef,xx,yy,zz);
          if ((meta & 8) != 0) {
            lastTickFoundBlocks+=70;
            int chance=(int)(1 + (((float)BlockCountRate) / 120F));
            Block block2=getBlock(worldRef,xx,yy - 1,zz);
            int meta2=getBlockMetadata(worldRef,xx,yy - 1,zz);
            Block block3=getBlock(worldRef,xx,yy + 10,zz);
            if ((((block2 == null || block2.getMaterial(block2.getDefaultState()) != Material.WATER) || (meta2 & 8) == 0) && (block3 != null && block3.getMaterial(block3.getDefaultState()) == Material.WATER)) || worldRef.rand.nextInt(chance) == 0) {
              float range=0.5F;
              EntityRotFX waterP;
              waterP=new EntityWaterfallFX(worldRef,(double)xx + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)yy + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)zz + 0.5F + ((rand.nextFloat() * range) - (range / 2)),0D,0D,0D,6D,2);
              if (((block2 == null || block2.getMaterial(block2.getDefaultState()) != Material.WATER) || (meta2 & 8) == 0) && (block3 != null && block3.getMaterial(block3.getDefaultState()) == Material.WATER)) {
                range=2F;
                float speed=0.2F;
                for (int i=0; i < 10; i++) {
                  if (worldRef.rand.nextInt(chance / 2) == 0) {
                    waterP=new EntityWaterfallFX(worldRef,(double)xx + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)yy + 0.7F + ((rand.nextFloat() * range) - (range / 2)),(double)zz + 0.5F + ((rand.nextFloat() * range) - (range / 2)),((rand.nextFloat() * speed) - (speed / 2)),((rand.nextFloat() * speed) - (speed / 2)),((rand.nextFloat() * speed) - (speed / 2)),2D,3);
                    waterP.setMotionY(4.5F);
                    spawnQueueNormal.add(waterP);
                  }
                }
              }
 else {
                waterP=new EntityWaterfallFX(worldRef,(double)xx + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)yy + 0.5F + ((rand.nextFloat() * range) - (range / 2)),(double)zz + 0.5F + ((rand.nextFloat() * range) - (range / 2)),0D,0D,0D,6D,2);
                waterP.setMotionY(0.5F);
                spawnQueueNormal.add(waterP);
              }
            }
          }
        }
 else         if (ConfigParticle.Wind_Particle_fire && (block != null && block == Blocks.FIRE)) {
          lastTickFoundBlocks++;
          if (worldRef.rand.nextInt(Math.max(1,(spawnRate / 100))) == 0) {
            double speed=0.15D;
            EntityRotFX entityfx=pm.spawnNewParticleIconFX(worldRef,ParticleRegistry.smoke,xx + rand.nextDouble(),yy + 0.2D + rand.nextDouble() * 0.2D,zz + rand.nextDouble(),(rand.nextDouble() - rand.nextDouble()) * speed,0.03D,(rand.nextDouble() - rand.nextDouble()) * speed);
            ParticleBehaviors.setParticleRandoms(entityfx,true,true);
            ParticleBehaviors.setParticleFire(entityfx);
            entityfx.setMaxAge(100 + rand.nextInt(300));
            spawnQueueNormal.add(entityfx);
          }
        }
 else         if (false && CoroUtilBlock.isAir(block)) {
        }
      }
    }
  }
}