nus-yam/ex-repair huggingface dataset:
Program: 12727
Project: 12727
Buggy source:
@Override public void onLivingUpdate(){
  if (!prevAttacking && this.getAttackTarget() != null) {
    prevAttacking=true;
    this.applyEntityAttributes(true);
  }
  if (prevAttacking && this.getAttackTarget() == null) {
    prevAttacking=false;
    this.applyEntityAttributes(false);
  }
  if (!worldObj.isRemote && shouldSpawnMinion()) {
    int i=0;
    if (this.recentlyHit > 0) {
      i=this.rand.nextInt(3);
    }
    IMinion m=null;
    if (i == 1) {
      EntityLiving e=(EntityLiving)EntityList.createEntityByName(REFERENCE.ENTITY.VAMPIRE_MINION_SAVEABLE_NAME,this.worldObj);
      e.copyLocationAndAnglesFrom(this);
      worldObj.spawnEntityInWorld(e);
      m=(IMinion)e;
    }
 else     if (i == 2 && this.getAttackTarget() != null) {
      m=(IMinion)Helper.spawnEntityBehindEntity(this.getAttackTarget(),REFERENCE.ENTITY.VAMPIRE_MINION_SAVEABLE_NAME);
    }
    if (m == null) {
      m=(IMinion)Helper.spawnEntityInWorld(worldObj,this.boundingBox.expand(19,4,19),REFERENCE.ENTITY.VAMPIRE_MINION_SAVEABLE_NAME,3);
    }
    if (m != null) {
      m.setLord(this);
    }
  }
  if (!this.worldObj.isRemote && VampirismMod.isSunDamageTime(this.worldObj)) {
    if (this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX),MathHelper.floor_double(this.posY),MathHelper.floor_double(this.posZ))) {
      this.teleportAway();
    }
  }
  super.onLivingUpdate();
}

Fixed version (ground truth):
@Override public void onLivingUpdate(){
  if (!prevAttacking && this.getAttackTarget() != null) {
    prevAttacking=true;
    this.applyEntityAttributes(true);
  }
  if (prevAttacking && this.getAttackTarget() == null) {
    prevAttacking=false;
    this.applyEntityAttributes(false);
  }
  if (!worldObj.isRemote && shouldSpawnMinion()) {
    int i=0;
    if (this.recentlyHit > 0) {
      i=this.rand.nextInt(3);
    }
    IMinion m=null;
    if (i == 1) {
      EntityLiving e=(EntityLiving)EntityList.createEntityByName(REFERENCE.ENTITY.VAMPIRE_MINION_SAVEABLE_NAME,this.worldObj);
      e.copyLocationAndAnglesFrom(this);
      worldObj.spawnEntityInWorld(e);
      m=(IMinion)e;
    }
 else     if (i == 2 && this.getAttackTarget() != null) {
      m=(IMinion)Helper.spawnEntityBehindEntity(this.getAttackTarget(),REFERENCE.ENTITY.VAMPIRE_MINION_SAVEABLE_NAME);
    }
    if (m == null) {
      m=(IMinion)Helper.spawnEntityInWorld(worldObj,this.boundingBox.expand(19,4,19),REFERENCE.ENTITY.VAMPIRE_MINION_SAVEABLE_NAME,3);
    }
    if (m != null) {
      m.setLord(this);
    }
  }
  if (!this.worldObj.isRemote && this.isGettingSundamage()) {
    if (this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX),MathHelper.floor_double(this.posY),MathHelper.floor_double(this.posZ))) {
      this.teleportAway();
    }
  }
  super.onLivingUpdate();
}
Program: 12728
Project: 12728
Buggy source:
@Override public boolean getCanSpawnHere(){
  int i=MathHelper.floor_double(this.boundingBox.minY);
  if (i < 60)   return false;
  CastlePositionData data=CastlePositionData.get(worldObj);
  if (!data.isPosAt(MathHelper.floor_double(posX),MathHelper.floor_double(posZ))) {
    return false;
  }
  return super.getCanSpawnHere();
}

Fixed version (ground truth):
@Override public boolean getCanSpawnHere(){
  int i=MathHelper.floor_double(this.boundingBox.minY);
  if (i < 60)   return false;
  CastlePositionData data=CastlePositionData.get(worldObj);
  if (data.isPosAt(MathHelper.floor_double(posX),MathHelper.floor_double(posZ))) {
    return false;
  }
  return super.getCanSpawnHere();
}
Program: 12731
Project: 12731
Buggy source:
@Override public ResourceLocation checkVampireTexture(Entity entity,ResourceLocation loc){
  if (entity instanceof AbstractClientPlayer) {
    if (Configs.modify_vampire_player_texture && VampirePlayer.get((EntityPlayer)entity).getLevel() > 0) {
      ResourceLocation vamp=new ResourceLocation("String_Node_Str" + loc.hashCode());
      TextureHelper.createVampireTexture((EntityLivingBase)entity,loc,vamp);
      return vamp;
    }
  }
 else   if (entity instanceof EntityCreature) {
    if (VampireMob.get((EntityCreature)entity).isVampire()) {
      ResourceLocation vamp=new ResourceLocation("String_Node_Str" + loc.hashCode());
      TextureHelper.createVampireTexture((EntityLiving)entity,loc,vamp);
      return vamp;
    }
  }
  return loc;
}

Fixed version (ground truth):
@Override public ResourceLocation checkVampireTexture(Entity entity,ResourceLocation loc){
  if (entity instanceof AbstractClientPlayer) {
    if (Configs.modify_vampire_player_texture && VampirePlayer.get((EntityPlayer)entity).getLevel() > 0) {
      ResourceLocation vamp=new ResourceLocation("String_Node_Str" + loc.getResourcePath());
      TextureHelper.createVampireTexture((EntityLivingBase)entity,loc,vamp);
      return vamp;
    }
  }
 else   if (entity instanceof EntityCreature) {
    if (VampireMob.get((EntityCreature)entity).isVampire()) {
      ResourceLocation vamp=new ResourceLocation("String_Node_Str" + loc.getResourceDomain() + "String_Node_Str"+ loc.getResourcePath());
      TextureHelper.createVampireTexture((EntityLiving)entity,loc,vamp);
      return vamp;
    }
  }
  return loc;
}
Program: 12732
Project: 12732
Buggy source:
/** 
 * Returns whether the EntityAIBase should begin execution.
 */
@Override public boolean shouldExecute(){
  boss=minion.getLord();
  if (boss == null) {
    return false;
  }
 else {
    double d0=this.boss.getTheDistanceSquared(minion.getRepresentingEntity());
    return d0 >= MINDIST && d0 <= MAXDIST;
  }
}

Fixed version (ground truth):
/** 
 * Returns whether the EntityAIBase should begin execution.
 */
@Override public boolean shouldExecute(){
  boss=minion.getLord();
  if (boss == null) {
    return false;
  }
 else {
    double d0=this.boss.getTheDistanceSquared(minion.getRepresentingEntity());
    return d0 >= MINDIST;
  }
}
Program: 12733
Project: 12733
Buggy source:
/** 
 * Returns whether an in-progress EntityAIBase should continue executing
 */
@Override public boolean continueExecuting(){
  if (!this.boss.isTheEntityAlive()) {
    boss=null;
    return false;
  }
 else {
    double d0=this.boss.getTheDistanceSquared(minion.getRepresentingEntity());
    return d0 >= MINDIST && d0 <= MAXDIST;
  }
}

Fixed version (ground truth):
/** 
 * Returns whether an in-progress EntityAIBase should continue executing
 */
@Override public boolean continueExecuting(){
  if (!this.boss.isTheEntityAlive()) {
    boss=null;
    return false;
  }
 else {
    double d0=this.boss.getTheDistanceSquared(minion.getRepresentingEntity());
    return d0 >= MINDIST;
  }
}
Program: 12734
Project: 12734
Buggy source:
@Override public boolean isEntityApplicable(Entity entity){
  IMinion m=MinionHelper.getMinionFromEntity(entity);
  if (selectPlayer) {
    if (entity instanceof EntityPlayer)     return true;
    if (MinionHelper.isLordSafe(m,minion.getLord())) {
      return false;
    }
  }
 else {
    if (entity instanceof EntityPlayer)     return false;
    if (MinionHelper.isLordPlayer(m))     return false;
  }
  if (excludeVampires) {
    IMinionLord l=minion.getLord();
    if (l != null && l instanceof VampirePlayer && ((VampirePlayer)l).isVampireLord()) {
      return true;
    }
    return false;
  }
  return targetClass.isAssignableFrom(entity.getClass());
}

Fixed version (ground truth):
@Override public boolean isEntityApplicable(Entity entity){
  IMinion m=MinionHelper.getMinionFromEntity(entity);
  if (selectPlayer) {
    if (MinionHelper.isLordSafe(m,minion.getLord())) {
      return false;
    }
    if (entity instanceof EntityPlayer)     return true;
  }
 else {
    if (entity instanceof EntityPlayer)     return false;
    if (MinionHelper.isLordPlayer(m))     return false;
  }
  if (excludeVampires) {
    if (entity instanceof EntityVampire) {
      IMinionLord l=minion.getLord();
      if (l != null && l instanceof VampirePlayer && ((VampirePlayer)l).isVampireLord()) {
        return true;
      }
      return false;
    }
  }
  return targetClass.isAssignableFrom(entity.getClass());
}
Program: 12735
Project: 12735
Buggy source:
/** 
 * Returns a new IEntitySelector for minion AI target tasks
 * @param minion The minion which the selector will be given
 * @param targetClass Class the target should have or extend.
 * @param selectPlayer If players and their minions should be selected as well. You do not need to set targetClass to EntityPlayer or any subclass of it.
 * @param excludeVampires If vampire npc should be excluded. Does not exclude vampires if the minions lord is a vampire lord
 * @return
 */
public static IEntitySelector getEntitySelectorForMinion(final IMinion minion,final Class<? extends Entity> targetClass,final boolean selectPlayer,final boolean excludeVampires){
  return new IEntitySelector(){
    @Override public boolean isEntityApplicable(    Entity entity){
      IMinion m=MinionHelper.getMinionFromEntity(entity);
      if (selectPlayer) {
        if (entity instanceof EntityPlayer)         return true;
        if (MinionHelper.isLordSafe(m,minion.getLord())) {
          return false;
        }
      }
 else {
        if (entity instanceof EntityPlayer)         return false;
        if (MinionHelper.isLordPlayer(m))         return false;
      }
      if (excludeVampires) {
        IMinionLord l=minion.getLord();
        if (l != null && l instanceof VampirePlayer && ((VampirePlayer)l).isVampireLord()) {
          return true;
        }
        return false;
      }
      return targetClass.isAssignableFrom(entity.getClass());
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a new IEntitySelector for minion AI target tasks
 * @param minion The minion which the selector will be given
 * @param targetClass Class the target should have or extend.
 * @param selectPlayer If players and their minions should be selected as well. You do not need to set targetClass to EntityPlayer or any subclass of it.
 * @param excludeVampires If vampire npc should be excluded. Does not exclude vampires if the minions lord is a vampire lord
 * @return
 */
public static IEntitySelector getEntitySelectorForMinion(final IMinion minion,final Class<? extends Entity> targetClass,final boolean selectPlayer,final boolean excludeVampires){
  return new IEntitySelector(){
    @Override public boolean isEntityApplicable(    Entity entity){
      IMinion m=MinionHelper.getMinionFromEntity(entity);
      if (selectPlayer) {
        if (MinionHelper.isLordSafe(m,minion.getLord())) {
          return false;
        }
        if (entity instanceof EntityPlayer)         return true;
      }
 else {
        if (entity instanceof EntityPlayer)         return false;
        if (MinionHelper.isLordPlayer(m))         return false;
      }
      if (excludeVampires) {
        if (entity instanceof EntityVampire) {
          IMinionLord l=minion.getLord();
          if (l != null && l instanceof VampirePlayer && ((VampirePlayer)l).isVampireLord()) {
            return true;
          }
          return false;
        }
      }
      return targetClass.isAssignableFrom(entity.getClass());
    }
  }
;
}
Program: 12736
Project: 12736
Buggy source:
public void loadMinions(NBTTagList list){
  if (list == null || list.tagCount() == 0) {
    Logger.d(TAG,"String_Node_Str");
    return;
  }
  Logger.d(TAG,"String_Node_Str" + list.tagCount() + "String_Node_Str");
  loadedMinions=new ArrayList<IMinion>();
  for (int i=0; i < list.tagCount(); i++) {
    NBTTagCompound nbttagcompound=list.getCompoundTagAt(i);
    Entity entity=EntityList.createEntityFromNBT(nbttagcompound,lord.getRepresentingEntity().worldObj);
    if (entity != null && entity instanceof IMinion) {
      entity.posY=entity.posY + entity.height;
      loadedMinions.add((IMinion)entity);
      Logger.d(TAG,"String_Node_Str");
    }
 else {
      Logger.d(TAG,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void loadMinions(NBTTagList list){
  if (list == null || list.tagCount() == 0) {
    Logger.d(TAG,"String_Node_Str");
    return;
  }
  loadedMinions=new ArrayList<IMinion>();
  for (int i=0; i < list.tagCount(); i++) {
    NBTTagCompound nbttagcompound=list.getCompoundTagAt(i);
    Entity entity=EntityList.createEntityFromNBT(nbttagcompound,lord.getRepresentingEntity().worldObj);
    if (entity != null && entity instanceof IMinion) {
      entity.posY=entity.posY + entity.height;
      loadedMinions.add((IMinion)entity);
      Logger.d(TAG,"String_Node_Str");
    }
 else {
      Logger.d(TAG,"String_Node_Str");
    }
  }
}
Program: 12737
Project: 12737
Buggy source:
public void onCallActivated(int i){
  Logger.d(TAG,"String_Node_Str",i);
switch (i) {
case 1:
    this.lastRemoteMinionComebackCall=System.currentTimeMillis();
  break;
case 2:
minionHandler.notifyCall(Call.DEFEND_LORD);
break;
case 3:
minionHandler.notifyCall(Call.ATTACK_NON_PLAYER);
break;
case 4:
minionHandler.notifyCall(Call.ATTACK);
break;
case 5:
minionHandler.notifyCall(Call.FOLLOW);
break;
default :
}
}

Fixed version (ground truth):
public void onCallActivated(int i){
  Logger.d(TAG,"String_Node_Str",i);
switch (i) {
case 1:
    this.lastRemoteMinionComebackCall=System.currentTimeMillis();
  break;
case 2:
minionHandler.notifyCall(Call.DEFEND_LORD);
for (VampireMob m : MinionHelper.getNearMobMinions(this,20)) {
m.activateMinionCommand(m.getCommand(0));
}
break;
case 3:
minionHandler.notifyCall(Call.ATTACK_NON_PLAYER);
break;
case 4:
minionHandler.notifyCall(Call.ATTACK);
break;
case 5:
minionHandler.notifyCall(Call.FOLLOW);
for (VampireMob m : MinionHelper.getNearMobMinions(this,20)) {
m.activateMinionCommand(m.getCommand(1));
}
break;
default :
}
}
Program: 12738
Project: 12738
Buggy source:
@Override public EntityLivingBase getMinionTarget(){
  if (this.minionTarget != null) {
    return minionTarget;
  }
  return player.getLastAttacker();
}

Fixed version (ground truth):
@Override public EntityLivingBase getMinionTarget(){
  if (this.minionTarget != null) {
    return minionTarget;
  }
  if (player.getLastAttackerTime() < player.ticksExisted + 200) {
    return player.getLastAttacker();
  }
  return null;
}
Program: 12739
Project: 12739
Buggy source:
private void renderBloodVisionFog(int ticks){
  if (ticks < 1 || ticks > BLOOD_VISION_FADE_TICKS)   return;
  float f=((float)BLOOD_VISION_FADE_TICKS) / (float)ticks;
  GL11.glPushMatrix();
  GL11.glFog(GL11.GL_FOG_COLOR,this.setFogColorBuffer(0,1,0,1.0F));
  GL11.glFogi(GL11.GL_FOG_MODE,GL11.GL_LINEAR);
  GL11.glFogf(GL11.GL_FOG_START,4.0F * f);
  GL11.glFogf(GL11.GL_FOG_END,5.5F * f);
  GL11.glNormal3f(0.0F,-1.0F,0.0F);
  GL11.glColor4f(1F,1F,1F,1.0F);
  GL11.glFogf(GL11.GL_FOG_DENSITY,1.0F);
  GL11.glPopMatrix();
}

Fixed version (ground truth):
private void renderBloodVisionFog(int ticks){
  if (ticks < 1 || ticks > BLOOD_VISION_FADE_TICKS)   return;
  float f=((float)BLOOD_VISION_FADE_TICKS) / (float)ticks;
  GL11.glPushMatrix();
  boolean fog=GL11.glIsEnabled(GL11.GL_FOG);
  if (!fog)   GL11.glEnable(GL11.GL_FOG);
  GL11.glFog(GL11.GL_FOG_COLOR,this.setFogColorBuffer(0,1,0,1.0F));
  GL11.glFogi(GL11.GL_FOG_MODE,GL11.GL_LINEAR);
  GL11.glFogf(GL11.GL_FOG_START,4.0F * f);
  GL11.glFogf(GL11.GL_FOG_END,5.5F * f);
  GL11.glNormal3f(0.0F,-1.0F,0.0F);
  GL11.glColor4f(1F,1F,1F,1.0F);
  GL11.glFogf(GL11.GL_FOG_DENSITY,1.0F);
  if (!fog)   GL11.glDisable(GL11.GL_FOG);
  GL11.glPopMatrix();
}
Program: 12740
Project: 12740
Buggy source:
@SubscribeEvent public void dye(PlayerInteractEvent e){
  ItemStack i=null;
  if (e.entity instanceof EntityPlayer && e.entity.isSneaking() && e.action == Action.RIGHT_CLICK_BLOCK && (i=((EntityPlayer)e.entity).inventory.getCurrentItem()) != null && i.getItem() instanceof ItemDye) {
    ((TileEntityCoffin)e.world.getTileEntity(e.x,e.y,e.z)).changeColor(i.getItemDamage());
  }
}

Fixed version (ground truth):
@SubscribeEvent public void dye(PlayerInteractEvent e){
  ItemStack i=null;
  if (e.entity instanceof EntityPlayer && e.entity.isSneaking() && e.action == Action.RIGHT_CLICK_BLOCK && (i=((EntityPlayer)e.entity).inventory.getCurrentItem()) != null && i.getItem() instanceof ItemDye) {
    ((TileEntityCoffin)e.world.getTileEntity(e.x,e.y,e.z)).getPrimaryTileEntity().changeColor(i.getItemDamage());
  }
}
Program: 12741
Project: 12741
Buggy source:
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  TileEntityCoffin tile=(TileEntityCoffin)te;
  if ((te.getBlockMetadata() & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getBlockMetadata() & 4) != 0;
  Logger.i("String_Node_Str","String_Node_Str",tile.getPrimaryTileEntity() == tile);
  if (!occupied && tile.lidPos > 0)   tile.lidPos--;
 else   if (occupied && tile.lidPos < maxLidPos)   tile.lidPos++;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  int color=Math.min(tile.color,15);
  bindTexture(textures[color]);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(tile.lidPos));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  TileEntityCoffin tile=(TileEntityCoffin)te;
  if ((te.getBlockMetadata() & (-8)) == 0)   return;
  boolean occupied=(te.getBlockMetadata() & 4) != 0;
  if (!occupied && tile.lidPos > 0)   tile.lidPos--;
 else   if (occupied && tile.lidPos < maxLidPos)   tile.lidPos++;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  int color=Math.min(tile.color,15);
  bindTexture(textures[color]);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(tile.lidPos));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}
Program: 12742
Project: 12742
Buggy source:
@SubscribeEvent public void dye(PlayerInteractEvent e){
  ItemStack i=null;
  if (e.entityPlayer.isSneaking() && e.action == Action.RIGHT_CLICK_BLOCK && e.world.getBlock(e.x,e.y,e.z).equals(ModBlocks.coffin) && (i=(e.entityPlayer).inventory.getCurrentItem()) != null && i.getItem() instanceof ItemDye) {
    int color=i.getItemDamage();
    TileEntityCoffin t=(TileEntityCoffin)e.world.getTileEntity(e.x,e.y,e.z);
    if (t == null)     return;
    t=t.getPrimaryTileEntity();
    if (t == null)     return;
    t.changeColor(color);
    e.useBlock=Result.DENY;
    e.useItem=Result.DENY;
    if (!e.entityPlayer.capabilities.isCreativeMode) {
      i.stackSize--;
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void dye(PlayerInteractEvent e){
  if (e.world.isRemote)   return;
  ItemStack i=null;
  if (e.entityPlayer.isSneaking() && e.action == Action.RIGHT_CLICK_BLOCK && e.world.getBlock(e.x,e.y,e.z).equals(ModBlocks.coffin) && (i=(e.entityPlayer).inventory.getCurrentItem()) != null && i.getItem() instanceof ItemDye) {
    int color=i.getItemDamage();
    TileEntityCoffin t=(TileEntityCoffin)e.world.getTileEntity(e.x,e.y,e.z);
    if (t == null)     return;
    t=t.getPrimaryTileEntity();
    if (t == null)     return;
    t.changeColor(color);
    e.useBlock=Result.DENY;
    e.useItem=Result.DENY;
    if (!e.entityPlayer.capabilities.isCreativeMode) {
      i.stackSize--;
    }
  }
}
Program: 12743
Project: 12743
Buggy source:
@Override public void updateEntity(){
  if ((this.getBlockMetadata() & 8) == 0)   return;
  if (!this.worldObj.isRemote && (occupied != ((this.getBlockMetadata() & 4) != 0))) {
    occupied=!occupied;
    needsAnimation=true;
    markDirty();
  }
 else   BlockBed.func_149979_a(worldObj,xCoord,yCoord,zCoord,occupied);
}

Fixed version (ground truth):
@Override public void updateEntity(){
  if ((this.getBlockMetadata() & -8) == 0)   return;
  if (!this.worldObj.isRemote && (occupied != ((this.getBlockMetadata() & 4) != 0))) {
    occupied=!occupied;
    needsAnimation=true;
    markDirty();
  }
 else   BlockBed.func_149979_a(worldObj,xCoord,yCoord,zCoord,occupied);
}
Program: 12744
Project: 12744
Buggy source:
public void changeColor(int color){
  this.color=color;
  needsAnimation=false;
  markDirty();
}

Fixed version (ground truth):
public void changeColor(int color){
  Logger.i("String_Node_Str","String_Node_Str",this.color,color,this.toString());
  this.color=color;
  needsAnimation=false;
  markDirty();
}
Program: 12745
Project: 12745
Buggy source:
public TileEntityCoffin getPrimaryTileEntity(){
  if ((this.worldObj.getBlockMetadata(this.otherX,this.yCoord,this.zCoord) & -8) == 0)   return (TileEntityCoffin)worldObj.getTileEntity(otherX,otherY,otherZ);
  return this;
}

Fixed version (ground truth):
public TileEntityCoffin getPrimaryTileEntity(){
  if ((this.getBlockMetadata() & -8) == 0)   return (TileEntityCoffin)worldObj.getTileEntity(otherX,otherY,otherZ);
  return this;
}
Program: 12746
Project: 12746
Buggy source:
public RendererCoffin(){
  model=new ModelCoffin();
  for (int i=0; i < colors.length; i++) {
    Logger.i("String_Node_Str",String.format("String_Node_Str",colors[i],i));
    textures[i]=new ResourceLocation(REFERENCE.MODID + "String_Node_Str" + colors[i]+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public RendererCoffin(){
  model=new ModelCoffin();
  for (int i=0; i < colors.length; i++) {
    textures[i]=new ResourceLocation(REFERENCE.MODID + "String_Node_Str" + colors[i]+ "String_Node_Str");
  }
}
Program: 12747
Project: 12747
Buggy source:
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  TileEntityCoffin tile=(TileEntityCoffin)te;
  if (te instanceof TileEntityCoffin)   if ((te.getBlockMetadata() & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getBlockMetadata() & 4) != 0;
  if (!occupied && tile.lidPos > 0)   tile.lidPos--;
 else   if (occupied && tile.lidPos < maxLidPos)   tile.lidPos++;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(textures[((TileEntityCoffin)te).color]);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(tile.lidPos));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  TileEntityCoffin tile=(TileEntityCoffin)te;
  if ((te.getBlockMetadata() & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getBlockMetadata() & 4) != 0;
  Logger.i("String_Node_Str","String_Node_Str",tile.getPrimaryTileEntity() == tile);
  if (!occupied && tile.lidPos > 0)   tile.lidPos--;
 else   if (occupied && tile.lidPos < maxLidPos)   tile.lidPos++;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  int color=Math.min(tile.color,15);
  bindTexture(textures[color]);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(tile.lidPos));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}
Program: 12748
Project: 12748
Buggy source:
@Override public void registerSubscriptions(){
  MinecraftForge.EVENT_BUS.register(new VampirePlayerEventHandler());
  MinecraftForge.EVENT_BUS.register(new VampireEntityEventHandler());
  MinecraftForge.EVENT_BUS.register(new de.teamlapen.vampirism.block.BlockCoffin());
  MinecraftForge.EVENT_BUS.register(this);
  FMLCommonHandler.instance().bus().register(this);
}

Fixed version (ground truth):
@Override public void registerSubscriptions(){
  MinecraftForge.EVENT_BUS.register(new VampirePlayerEventHandler());
  MinecraftForge.EVENT_BUS.register(new VampireEntityEventHandler());
  MinecraftForge.EVENT_BUS.register(this);
  FMLCommonHandler.instance().bus().register(this);
}
Program: 12749
Project: 12749
Buggy source:
public TileEntityCoffin getPrimaryTileEntity(){
  if ((this.worldObj.getBlockMetadata(this.otherX,this.yCoord,this.zCoord) & -8) != 0)   return (TileEntityCoffin)worldObj.getTileEntity(otherX,otherY,otherZ);
  return this;
}

Fixed version (ground truth):
public TileEntityCoffin getPrimaryTileEntity(){
  if ((this.worldObj.getBlockMetadata(this.otherX,this.yCoord,this.zCoord) & -8) == 0)   return (TileEntityCoffin)worldObj.getTileEntity(otherX,otherY,otherZ);
  return this;
}
Program: 12751
Project: 12751
Buggy source:
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  if (te instanceof TileEntityCoffin)   if ((te.getWorldObj().getBlockMetadata(te.xCoord,te.yCoord,te.zCoord) & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getWorldObj().getBlockMetadata(te.xCoord,te.yCoord,te.zCoord) & 4) != 0;
  if (!occupied && lidPosition > 0)   lidPosition--;
 else   if (occupied && lidPosition < maxLidPos)   lidPosition++;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(texture);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(lidPosition));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  if (te instanceof TileEntityCoffin)   if ((te.getWorldObj().getBlockMetadata(te.xCoord,te.yCoord,te.zCoord) & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getWorldObj().getBlockMetadata(te.xCoord,te.yCoord,te.zCoord) & 4) != 0;
  if (!occupied && lidPosition > 0)   lidPosition--;
 else   if (occupied && lidPosition < maxLidPos)   lidPosition++;
  Logger.i("String_Node_Str","String_Node_Str" + lidPosition + "String_Node_Str"+ occupied);
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(texture);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(lidPosition));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}
Program: 12752
Project: 12752
Buggy source:
private void wakeSleepingPlayer(World world,int x,int y,int z){
  if (world.isRemote)   return;
  WorldServer w=(WorldServer)world;
  for (int i=0; i < w.playerEntities.size(); i++) {
    EntityPlayer p=((EntityPlayer)w.playerEntities.get(i));
    if (p.isPlayerSleeping()) {
      Logger.i("String_Node_Str",String.format("String_Node_Str",p.playerLocation.posX,p.playerLocation.posY,p.playerLocation.posZ));
      if (p.playerLocation.posX == x && p.playerLocation.posY == y && p.playerLocation.posZ == z) {
        VampirePlayer.get(p).sleepingCoffin=false;
      }
    }
  }
}

Fixed version (ground truth):
private void wakeSleepingPlayer(World world,int x,int y,int z){
  if (world.isRemote)   return;
  WorldServer w=(WorldServer)world;
  for (int i=0; i < w.playerEntities.size(); i++) {
    EntityPlayer p=((EntityPlayer)w.playerEntities.get(i));
    if (p.isPlayerSleeping()) {
      Logger.i("String_Node_Str",String.format("String_Node_Str",p.playerLocation.posX,p.playerLocation.posY,p.playerLocation.posZ));
      if (p.playerLocation.posX == x && p.playerLocation.posY == y && p.playerLocation.posZ == z) {
        VampirePlayer.get(p).wakeUpPlayer(false,true,false,false);
      }
    }
  }
}
Program: 12753
Project: 12753
Buggy source:
public static boolean shouldWakePlayer(EntityPlayer p,boolean p1,boolean p2,boolean p3){
  if (p.worldObj.isRemote)   return true;
  Throwable t=new Throwable();
  if (t.getStackTrace()[2].toString().startsWith("String_Node_Str")) {
    Logger.i("String_Node_Str",String.format("String_Node_Str",VampirePlayer.get(p).toString(),p.isPlayerSleeping()));
    VampirePlayer.get(p).sleepingCoffin=false;
    ((EntityPlayerMP)p).wakeUpPlayer(p1,p2,p3);
    return true;
  }
  if (VampirePlayer.get(p) != null && VampirePlayer.get(p).sleepingCoffin) {
    return false;
  }
  Logger.i("String_Node_Str",String.format("String_Node_Str",p.worldObj.isRemote));
  return true;
}

Fixed version (ground truth):
public static boolean shouldWakePlayer(EntityPlayer p,boolean p1,boolean p2,boolean p3){
  if (p.worldObj.isRemote)   return true;
  Throwable t=new Throwable();
  if (t.getStackTrace()[2].toString().startsWith("String_Node_Str")) {
    Logger.i("String_Node_Str",String.format("String_Node_Str",VampirePlayer.get(p).toString(),p.isPlayerSleeping()));
    VampirePlayer.get(p).wakeUpPlayer(false,p1,p2,p3);
    return true;
  }
  if (VampirePlayer.get(p) != null && VampirePlayer.get(p).sleepingCoffin) {
    return false;
  }
  Logger.i("String_Node_Str",String.format("String_Node_Str",p.worldObj.isRemote));
  return true;
}
Program: 12755
Project: 12755
Buggy source:
private void writeNBT(NBTTagCompound nbt){
  nbt.setInteger("String_Node_Str",bloodTimer);
  nbt.setFloat("String_Node_Str",bloodExhaustionLevel);
  nbt.setFloat("String_Node_Str",bloodSaturationLevel);
  nbt.setBoolean("String_Node_Str",sleepingCoffin);
}

Fixed version (ground truth):
private void writeNBT(NBTTagCompound nbt){
  nbt.setInteger("String_Node_Str",bloodTimer);
  nbt.setFloat("String_Node_Str",bloodExhaustionLevel);
  nbt.setFloat("String_Node_Str",bloodSaturationLevel);
}
Program: 12756
Project: 12756
Buggy source:
private void readNBT(NBTTagCompound nbt){
  if (nbt.hasKey("String_Node_Str")) {
    bloodTimer=nbt.getInteger("String_Node_Str");
    bloodExhaustionLevel=nbt.getFloat("String_Node_Str");
    bloodSaturationLevel=nbt.getFloat("String_Node_Str");
  }
  if (nbt.hasKey("String_Node_Str"))   sleepingCoffin=nbt.getBoolean("String_Node_Str");
}

Fixed version (ground truth):
private void readNBT(NBTTagCompound nbt){
  if (nbt.hasKey("String_Node_Str")) {
    bloodTimer=nbt.getInteger("String_Node_Str");
    bloodExhaustionLevel=nbt.getFloat("String_Node_Str");
    bloodSaturationLevel=nbt.getFloat("String_Node_Str");
  }
}
Program: 12757
Project: 12757
Buggy source:
public boolean onEntityAttacked(DamageSource source,float amount){
  if (source.getEntity() instanceof DefaultVampire && getLevel() == 0) {
    if (player.worldObj.rand.nextInt(BALANCE.VAMPIRE_PLAYER_SANGUINARE_PROB * 4) == 0) {
      if (!player.isPotionActive(ModPotion.sanguinare)) {
        player.addPotionEffect(new PotionEffect(ModPotion.sanguinare.id,BALANCE.VAMPIRE_PLAYER_SANGUINARE_DURATION * 20));
      }
    }
  }
  if (source.getEntity() instanceof EntityLivingBase && getLevel() > 0) {
    this.minionTarget=(EntityLivingBase)source.getEntity();
    return false;
  }
  if (DamageSource.fall.equals(source) && !this.skipFallDamageReduction) {
    float i=amount - (getLevel() / 3) - 1;
    if (i > 0) {
      this.skipFallDamageReduction=true;
      player.attackEntityFrom(DamageSource.fall,i);
      this.skipFallDamageReduction=false;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * If this returns true, the damage is skipped
 * @param source
 * @param amount
 * @return
 */
public boolean onEntityAttacked(DamageSource source,float amount){
  if (source.getEntity() instanceof DefaultVampire && getLevel() == 0) {
    if (player.worldObj.rand.nextInt(BALANCE.VAMPIRE_PLAYER_SANGUINARE_PROB * 4) == 0) {
      if (!player.isPotionActive(ModPotion.sanguinare)) {
        player.addPotionEffect(new PotionEffect(ModPotion.sanguinare.id,BALANCE.VAMPIRE_PLAYER_SANGUINARE_DURATION * 20));
      }
    }
  }
  if (source.getEntity() instanceof EntityLivingBase && getLevel() > 0) {
    this.minionTarget=(EntityLivingBase)source.getEntity();
    return false;
  }
  if (DamageSource.fall.equals(source) && !this.skipFallDamageReduction) {
    float i=amount - (getLevel() / 3) - 1;
    if (i > 0) {
      this.skipFallDamageReduction=true;
      player.attackEntityFrom(DamageSource.fall,i);
      this.skipFallDamageReduction=false;
    }
    return true;
  }
  Logger.i(TAG,"String_Node_Str" + this.sleepingCoffin + "String_Node_Str"+ player.isPlayerSleeping());
  if (sleepingCoffin && !player.isEntityInvulnerable() && !(player.capabilities.disableDamage && !source.canHarmInCreative())) {
    this.wakeUpPlayer(false,true,false,false);
  }
  return false;
}
Program: 12759
Project: 12759
Buggy source:
@SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event){
  WorldServer server=MinecraftServer.getServer().worldServerForDimension(0);
  if (server.areAllPlayersAsleep()) {
    Logger.i("String_Node_Str","String_Node_Str");
    long i=server.getWorldTime() + 24000L;
    server.setWorldTime(i - i % 24000L - 11000L);
    wakeAllPlayers(server);
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event){
  WorldServer server=MinecraftServer.getServer().worldServerForDimension(0);
  if (server.areAllPlayersAsleep()) {
    Logger.i("String_Node_Str","String_Node_Str");
    if (server.playerEntities.size() > 0) {
      if (VampirePlayer.get(((EntityPlayer)server.playerEntities.get(0))).sleepingCoffin) {
        Logger.i("String_Node_Str","String_Node_Str");
        long i=server.getWorldTime() + 24000L;
        server.setWorldTime(i - i % 24000L - 11000L);
        wakeAllPlayers(server);
      }
 else {
        Logger.i("String_Node_Str","String_Node_Str");
      }
    }
  }
}
Program: 12760
Project: 12760
Buggy source:
private void wakeAllPlayers(WorldServer server){
  this.allPlayersSleepingCoffin=false;
  Iterator iterator=server.playerEntities.iterator();
  while (iterator.hasNext()) {
    EntityPlayerMP p=(EntityPlayerMP)iterator.next();
    VampirePlayer.get(p).sleepingCoffin=false;
    VampirePlayer.get(p).sync(true);
    p.wakeUpPlayer(false,false,true);
  }
}

Fixed version (ground truth):
private void wakeAllPlayers(WorldServer server){
  Iterator iterator=server.playerEntities.iterator();
  while (iterator.hasNext()) {
    EntityPlayerMP p=(EntityPlayerMP)iterator.next();
    VampirePlayer.get(p).wakeUpPlayer(true,false,false,true);
  }
}
Program: 12762
Project: 12762
Buggy source:
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  if (te instanceof TileEntityCoffin)   if ((te.getWorldObj().getBlockMetadata(te.xCoord,te.yCoord,te.zCoord) & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getWorldObj().getBlockMetadata(te.xCoord,te.yCoord,te.zCoord) & 4) != 0;
  if (!occupied && lidPosition > 0)   lidPosition--;
 else   if (occupied && lidPosition < maxLidPos)   lidPosition++;
  Logger.i("String_Node_Str","String_Node_Str" + lidPosition + "String_Node_Str"+ occupied);
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(texture);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(lidPosition));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float scale){
  TileEntityCoffin tile=(TileEntityCoffin)te;
  if (te instanceof TileEntityCoffin)   if ((te.getBlockMetadata() & (-8)) == 0) {
    return;
  }
  boolean occupied=(te.getBlockMetadata() & 4) != 0;
  if (!occupied && tile.lidPos > 0)   tile.lidPos--;
 else   if (occupied && tile.lidPos < maxLidPos)   tile.lidPos++;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(texture);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.rotateLid(calcLidAngle(tile.lidPos));
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
}
Program: 12763
Project: 12763
Buggy source:
public void readFromNBT(NBTTagCompound par1NBTTagCompound){
  super.readFromNBT(par1NBTTagCompound);
  this.otherX=par1NBTTagCompound.getInteger("String_Node_Str");
  this.otherY=par1NBTTagCompound.getInteger("String_Node_Str");
  this.otherZ=par1NBTTagCompound.getInteger("String_Node_Str");
}

Fixed version (ground truth):
public void readFromNBT(NBTTagCompound par1NBTTagCompound){
  super.readFromNBT(par1NBTTagCompound);
  this.otherX=par1NBTTagCompound.getInteger("String_Node_Str");
  this.otherY=par1NBTTagCompound.getInteger("String_Node_Str");
  this.otherZ=par1NBTTagCompound.getInteger("String_Node_Str");
  this.occupied=par1NBTTagCompound.getBoolean("String_Node_Str");
}
Program: 12764
Project: 12764
Buggy source:
public void writeToNBT(NBTTagCompound par1NBTTagCompound){
  super.writeToNBT(par1NBTTagCompound);
  par1NBTTagCompound.setInteger("String_Node_Str",otherX);
  par1NBTTagCompound.setInteger("String_Node_Str",otherY);
  par1NBTTagCompound.setInteger("String_Node_Str",otherZ);
}

Fixed version (ground truth):
public void writeToNBT(NBTTagCompound par1NBTTagCompound){
  super.writeToNBT(par1NBTTagCompound);
  par1NBTTagCompound.setInteger("String_Node_Str",otherX);
  par1NBTTagCompound.setInteger("String_Node_Str",otherY);
  par1NBTTagCompound.setInteger("String_Node_Str",otherZ);
  par1NBTTagCompound.setBoolean("String_Node_Str",occupied);
}
Program: 12767
Project: 12767
Buggy source:
public void onDeath(DamageSource source){
  if (BALANCE.VAMPIRE_PLAYER_LOOSE_LEVEL && source.damageType.equals("String_Node_Str") && source instanceof EntityDamageSource) {
    Entity src=source.getEntity();
    if (src instanceof EntityVampireHunter) {
      looseLevel();
      this.setVampireLord(false);
    }
    if (src instanceof EntityVampire || (src instanceof IMinion && ((IMinion)src).getLord() instanceof EntityLiving)) {
      EntityLiving old;
      if (src instanceof IMinion) {
        old=(EntityLiving)((IMinion)src).getLord();
      }
 else {
        old=(EntityLiving)src;
      }
      EntityDracula dracula=(EntityDracula)EntityList.createEntityByName(REFERENCE.ENTITY.DRACULA_NAME,old.worldObj);
      dracula.copyLocationAndAnglesFrom(old);
      dracula.makeDisappear();
      old.worldObj.spawnEntityInWorld(dracula);
      old.setDead();
      this.setVampireLord(false);
    }
  }
  for (int i=0; i < skillTimer.length; i++) {
    if (skillTimer[i] > 0) {
      skillTimer[i]=-Skills.getSkill(i).getCooldown();
      ((ILastingSkill)Skills.getSkill(i)).onDeactivated(this,player);
    }
  }
}

Fixed version (ground truth):
public void onDeath(DamageSource source){
  if (BALANCE.VAMPIRE_PLAYER_LOOSE_LEVEL && source.damageType.equals("String_Node_Str") && source instanceof EntityDamageSource) {
    Entity src=source.getEntity();
    if (src instanceof EntityVampireHunter) {
      looseLevel();
      this.setVampireLord(false);
    }
    if (isVampireLord() && src instanceof EntityVampire || (src instanceof IMinion && ((IMinion)src).getLord() instanceof EntityLiving)) {
      EntityLiving old;
      if (src instanceof IMinion) {
        old=(EntityLiving)((IMinion)src).getLord();
      }
 else {
        old=(EntityLiving)src;
      }
      EntityDracula dracula=(EntityDracula)EntityList.createEntityByName(REFERENCE.ENTITY.DRACULA_NAME,old.worldObj);
      dracula.copyLocationAndAnglesFrom(old);
      dracula.makeDisappear();
      old.worldObj.spawnEntityInWorld(dracula);
      old.setDead();
      this.setVampireLord(false);
    }
  }
  for (int i=0; i < skillTimer.length; i++) {
    if (skillTimer[i] > 0) {
      skillTimer[i]=-Skills.getSkill(i).getCooldown();
      ((ILastingSkill)Skills.getSkill(i)).onDeactivated(this,player);
    }
  }
}
Program: 12768
Project: 12768
Buggy source:
@Override public void registerEntitys(){
  int entityId=0;
  BiomeGenBase[] allBiomes=BiomeGenBase.getBiomeGenArray();
  allBiomes[9]=null;
  allBiomes[8]=null;
  BiomeGenBase[] biomes=Iterators.toArray(Iterators.filter(Iterators.forArray(allBiomes),Predicates.notNull()),BiomeGenBase.class);
  registerEntity(EntityVampireHunter.class,REFERENCE.ENTITY.VAMPIRE_HUNTER_NAME,BALANCE.VAMPIRE_HUNTER_SPAWN_PROBE,1,2,EnumCreatureType.creature,biomes);
  registerEntity(EntityVampire.class,REFERENCE.ENTITY.VAMPIRE_NAME,BALANCE.VAMPIRE_SPAWN_PROBE,1,3,EnumCreatureType.monster,biomes);
  registerEntity(EntityVampireLord.class,REFERENCE.ENTITY.VAMPIRE_LORD_NAME,BALANCE.VAMPIRE_LORD_SPAWN_PROBE,1,1,EnumCreatureType.monster,ModBiomes.biomeVampireForest);
  registerEntity(EntityVampireMinion.class,REFERENCE.ENTITY.VAMPIRE_MINION_NAME,false);
  registerEntity(EntityDeadMob.class,REFERENCE.ENTITY.DEAD_MOB_NAME,false);
  registerEntity(EntityGhost.class,REFERENCE.ENTITY.GHOST_NAME,5,1,2,EnumCreatureType.monster,ModBiomes.biomeVampireForest);
}

Fixed version (ground truth):
@Override public void registerEntitys(){
  int entityId=0;
  BiomeGenBase[] allBiomes=BiomeGenBase.getBiomeGenArray();
  allBiomes[9]=null;
  allBiomes[8]=null;
  BiomeGenBase[] biomes=Iterators.toArray(Iterators.filter(Iterators.forArray(allBiomes),Predicates.notNull()),BiomeGenBase.class);
  registerEntity(EntityVampireHunter.class,REFERENCE.ENTITY.VAMPIRE_HUNTER_NAME,BALANCE.VAMPIRE_HUNTER_SPAWN_PROBE,1,2,EnumCreatureType.creature,biomes);
  registerEntity(EntityVampire.class,REFERENCE.ENTITY.VAMPIRE_NAME,BALANCE.VAMPIRE_SPAWN_PROBE,1,3,EnumCreatureType.monster,biomes);
  registerEntity(EntityVampireLord.class,REFERENCE.ENTITY.VAMPIRE_LORD_NAME,BALANCE.VAMPIRE_LORD_SPAWN_PROBE,1,1,EnumCreatureType.monster,ModBiomes.biomeVampireForest);
  registerEntity(EntityVampireMinion.class,REFERENCE.ENTITY.VAMPIRE_MINION_NAME,false);
  registerEntity(EntityDeadMob.class,REFERENCE.ENTITY.DEAD_MOB_NAME,false);
  registerEntity(EntityDracula.class,REFERENCE.ENTITY.DRACULA_NAME,false);
  registerEntity(EntityGhost.class,REFERENCE.ENTITY.GHOST_NAME,5,1,2,EnumCreatureType.monster,ModBiomes.biomeVampireForest);
}
Program: 12770
Project: 12770
Buggy source:
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float par5){
  TileEntityBloodAltarTier4 te4=(TileEntityBloodAltarTier4)te;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(texture);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
  PHASE phase=te4.getPhase();
  if (phase == PHASE.BEAM1 || phase == PHASE.BEAM2) {
    x+=0.5;
    y+=3;
    z+=0.5;
    double cX=te.xCoord + 0.5;
    double cY=te.yCoord + 3;
    double cZ=te.zCoord + 0.5;
    try {
      ChunkCoordinates[] tips=te4.getTips();
      for (int i=0; i < tips.length; i++) {
        this.renderBeam(x,y,z,cX,cY,cZ,tips[i].posX + 0.5,tips[i].posY + 0.5,tips[i].posZ + 0.5,te4.getRunningTick() + par5,false);
      }
      if (phase == PHASE.BEAM2) {
        EntityPlayer p=te4.getPlayer();
        if (p != null) {
          this.renderBeam(0,-0.5,0,p.posX,p.posY,p.posZ,cX,cY + 0.2,cZ,-(te4.getRunningTick() + par5),true);
        }
      }
    }
 catch (    NullPointerException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity te,double x,double y,double z,float par5){
  TileEntityBloodAltarTier4 te4=(TileEntityBloodAltarTier4)te;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F);
  bindTexture(texture);
  GL11.glPushMatrix();
  adjustRotatePivotViaMeta(te.getWorldObj(),te.xCoord,te.yCoord,te.zCoord);
  GL11.glRotatef(180F,0.0F,0.0F,1.0F);
  model.render(null,0.0F,0.0F,-0.1F,0.0F,0.0F,0.0625F);
  GL11.glPopMatrix();
  GL11.glPopMatrix();
  PHASE phase=te4.getPhase();
  if (phase == PHASE.BEAM1 || phase == PHASE.BEAM2) {
    x+=0.5;
    y+=3;
    z+=0.5;
    double cX=te.xCoord + 0.5;
    double cY=te.yCoord + 3;
    double cZ=te.zCoord + 0.5;
    try {
      ChunkCoordinates[] tips=te4.getTips();
      for (int i=0; i < tips.length; i++) {
        this.renderBeam(x,y,z,cX,cY,cZ,tips[i].posX + 0.5,tips[i].posY + 0.5,tips[i].posZ + 0.5,te4.getRunningTick() + par5,false);
      }
      if (phase == PHASE.BEAM2) {
        EntityPlayer p=te4.getPlayer();
        if (p != null) {
          double rX=0, rZ=0;
          double rY=-0.3;
          double playerY=p.posY;
          if (!p.equals(Minecraft.getMinecraft().thePlayer)) {
            Entity e=Minecraft.getMinecraft().thePlayer;
            rX+=p.posX - e.posX;
            rY+=p.posY - e.posY + 1.5D;
            rZ+=p.posZ - e.posZ;
            playerY+=1.5D;
          }
          this.renderBeam(rX,rY,rZ,p.posX,playerY,p.posZ,cX,cY + 0.2,cZ,-(te4.getRunningTick() + par5),true);
        }
      }
    }
 catch (    NullPointerException e) {
    }
  }
}
Program: 12771
Project: 12771
Buggy source:
@Override public boolean generate(World world,Random rand,int x,int y,int z){
  if (!LocationIsValidSpawn(world,x,y,z) || !LocationIsValidSpawn(world,x + 2,y,z) || !LocationIsValidSpawn(world,x + 2,y,z + 2)|| !LocationIsValidSpawn(world,x,y,z + 2))   return false;
  Logger.i("String_Node_Str","String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ z);
  world.setBlock(x + 0,y + 0,z + 0,Blocks.obsidian,0,3);
  world.setBlock(x + 1,y + 0,z + 0,Blocks.obsidian,0,3);
  world.setBlock(x + 2,y + 0,z + 0,Blocks.obsidian,0,3);
  world.setBlock(x + 0,y + 0,z + 1,Blocks.obsidian,0,3);
  world.setBlock(x + 1,y + 0,z + 1,Blocks.obsidian,0,3);
  world.setBlock(x + 2,y + 0,z + 1,Blocks.obsidian,0,3);
  world.setBlock(x + 0,y + 0,z + 2,Blocks.obsidian,0,3);
  world.setBlock(x + 1,y + 0,z + 2,Blocks.obsidian,0,3);
  world.setBlock(x + 2,y + 0,z + 2,Blocks.obsidian,0,3);
  world.setBlock(x + 0,y + 1,z + 0,Blocks.air,0,3);
  world.setBlock(x + 1,y + 1,z + 0,Blocks.air,0,3);
  world.setBlock(x + 2,y + 1,z + 0,Blocks.air,0,3);
  world.setBlock(x + 0,y + 1,z + 1,Blocks.air,0,3);
  world.setBlock(x + 1,y + 1,z + 1,ModBlocks.bloodAltar,1,3);
  world.setBlock(x + 2,y + 1,z + 1,Blocks.air,0,3);
  world.setBlock(x + 0,y + 1,z + 2,Blocks.air,0,3);
  world.setBlock(x + 1,y + 1,z + 2,Blocks.air,0,3);
  world.setBlock(x + 2,y + 1,z + 2,Blocks.air,0,3);
  return true;
}

Fixed version (ground truth):
@Override public boolean generate(World world,Random rand,int x,int y,int z){
  if (!locationIsValidSpawn(world,x,y,z) || !locationIsValidSpawn(world,x + 2,y,z) || !locationIsValidSpawn(world,x + 2,y,z + 2)|| !locationIsValidSpawn(world,x,y,z + 2))   return false;
  Logger.i("String_Node_Str","String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ z);
  world.setBlock(x + 0,y + 0,z + 0,Blocks.obsidian,0,3);
  world.setBlock(x + 1,y + 0,z + 0,Blocks.obsidian,0,3);
  world.setBlock(x + 2,y + 0,z + 0,Blocks.obsidian,0,3);
  world.setBlock(x + 0,y + 0,z + 1,Blocks.obsidian,0,3);
  world.setBlock(x + 1,y + 0,z + 1,Blocks.obsidian,0,3);
  world.setBlock(x + 2,y + 0,z + 1,Blocks.obsidian,0,3);
  world.setBlock(x + 0,y + 0,z + 2,Blocks.obsidian,0,3);
  world.setBlock(x + 1,y + 0,z + 2,Blocks.obsidian,0,3);
  world.setBlock(x + 2,y + 0,z + 2,Blocks.obsidian,0,3);
  world.setBlock(x + 0,y + 1,z + 0,Blocks.air,0,3);
  world.setBlock(x + 1,y + 1,z + 0,Blocks.air,0,3);
  world.setBlock(x + 2,y + 1,z + 0,Blocks.air,0,3);
  world.setBlock(x + 0,y + 1,z + 1,Blocks.air,0,3);
  world.setBlock(x + 1,y + 1,z + 1,ModBlocks.bloodAltar,1,3);
  world.setBlock(x + 2,y + 1,z + 1,Blocks.air,0,3);
  world.setBlock(x + 0,y + 1,z + 2,Blocks.air,0,3);
  world.setBlock(x + 1,y + 1,z + 2,Blocks.air,0,3);
  world.setBlock(x + 2,y + 1,z + 2,Blocks.air,0,3);
  return true;
}