Program: 12766
Project: 12766
Buggy source:
/** 
 * Called every LivingEntityUpdate, returns immediately if level =0;
 */
public void onUpdate(){
  if (getLevel() <= 0) {
    PotionEffect sang=player.getActivePotionEffect(ModPotion.sanguinare);
    if (sang != null) {
      if (sang.getDuration() == 1) {
        this.levelUp();
        player.addPotionEffect(new PotionEffect(ModPotion.saturation.id,300,2));
        player.addPotionEffect(new PotionEffect(Potion.resistance.id,300));
      }
    }
    return;
  }
  this.bloodStats.onUpdate();
  if (!player.worldObj.isRemote) {
    if (gettingSundamage() && player.worldObj.rand.nextInt(40) == 10) {
      float dmg=BALANCE.getVampireSunDamage(getLevel());
      if (player.isPotionActive(ModPotion.sunscreen)) {
        dmg=dmg / 2;
      }
      player.attackEntityFrom(VampirismMod.sunDamage,dmg);
    }
    if (player.isPotionActive(ModPotion.sanguinare.id)) {
      player.removePotionEffect(ModPotion.sanguinare.id);
    }
    if (this.player.isPlayerSleeping()) {
      Helper.Reflection.setPrivateField(EntityPlayer.class,this.player,this.player.getSleepTimer() + 1,Helper.Obfuscation.getPosNames("String_Node_Str"));
    }
    if (this.player.getSleepTimer() > 100) {
      Helper.Reflection.setPrivateField(EntityPlayer.class,this.player,100,Helper.Obfuscation.getPosNames("String_Node_Str"));
    }
    if (!this.player.worldObj.isRemote) {
      if (!this.player.worldObj.isDaytime()) {
        this.player.wakeUpPlayer(false,true,true);
      }
    }
  }
  for (int i=0; i < skillTimer.length; i++) {
    int t=skillTimer[i];
    if (t != 0) {
      if (t < 0) {
        skillTimer[i]=++t;
      }
 else {
        skillTimer[i]=--t;
        ILastingSkill s=(ILastingSkill)Skills.getSkill(i);
        if (t == 0) {
          skillTimer[i]=-s.getCooldown();
          if (!isRemote()) {
            s.onDeactivated(this,player);
            dirty=true;
          }
        }
 else {
          if (s.onUpdate(this,player)) {
            skillTimer[i]=1;
          }
        }
      }
    }
  }
  if (batTransformed != this.isSkillActive(Skills.batMode)) {
    batTransformed=!batTransformed;
    VampirismMod.proxy.setPlayerBat(player,batTransformed);
  }
  if (minionTarget != null && !minionTarget.isEntityAlive()) {
    minionTarget=null;
  }
  if (dirty == true) {
    this.sync(true);
    dirty=false;
  }
}

Fixed version (ground truth):
/** 
 * Called every LivingEntityUpdate, returns immediately if level =0;
 */
public void onUpdate(){
  if (getLevel() <= 0) {
    PotionEffect sang=player.getActivePotionEffect(ModPotion.sanguinare);
    if (sang != null) {
      if (sang.getDuration() == 1) {
        this.levelUp();
        player.addPotionEffect(new PotionEffect(ModPotion.saturation.id,300,2));
        player.addPotionEffect(new PotionEffect(Potion.resistance.id,300));
      }
    }
    return;
  }
  this.bloodStats.onUpdate();
  if (!player.worldObj.isRemote) {
    if (gettingSundamage() && player.worldObj.rand.nextInt(40) == 10) {
      float dmg=BALANCE.getVampireSunDamage(getLevel());
      if (player.isPotionActive(ModPotion.sunscreen)) {
        dmg=dmg / 2;
      }
      player.attackEntityFrom(VampirismMod.sunDamage,dmg);
    }
    if (player.isPotionActive(ModPotion.sanguinare.id)) {
      player.removePotionEffect(ModPotion.sanguinare.id);
    }
    if (!this.player.worldObj.isDaytime()) {
      sleepingCoffin=false;
    }
  }
  for (int i=0; i < skillTimer.length; i++) {
    int t=skillTimer[i];
    if (t != 0) {
      if (t < 0) {
        skillTimer[i]=++t;
      }
 else {
        skillTimer[i]=--t;
        ILastingSkill s=(ILastingSkill)Skills.getSkill(i);
        if (t == 0) {
          skillTimer[i]=-s.getCooldown();
          if (!isRemote()) {
            s.onDeactivated(this,player);
            dirty=true;
          }
        }
 else {
          if (s.onUpdate(this,player)) {
            skillTimer[i]=1;
          }
        }
      }
    }
  }
  if (batTransformed != this.isSkillActive(Skills.batMode)) {
    batTransformed=!batTransformed;
    VampirismMod.proxy.setPlayerBat(player,batTransformed);
  }
  if (minionTarget != null && !minionTarget.isEntityAlive()) {
    minionTarget=null;
  }
  if (dirty == true) {
    this.sync(true);
    dirty=false;
  }
}