nus-yam/ex-repair huggingface dataset:
Program: 174615
Project: 174615
Buggy source:
@Override public IMessage onMessage(final PacketUpdateStats message,final MessageContext ctx){
  IThreadListener mainThread=Minecraft.getMinecraft();
  mainThread.addScheduledTask(new Runnable(){
    @Override public void run(){
      EntityPlayer player=Minecraft.getMinecraft().player;
      Stats statsCap=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        statsCap.setMana(message.mana);
        statsCap.setMaxMana(message.maxMana);
        statsCap.setManaPerSecond(message.manaPerSecond);
        statsCap.setMagicalPower(message.magicalPower);
        statsCap.setHealthPerSecond(message.healthPerSecond);
        statsCap.setCriticalChance(message.criticalChance);
        statsCap.setCriticalDamage(message.criticalDamage);
      }
    }
  }
);
  return null;
}

Fixed version (ground truth):
@Override public IMessage onMessage(final PacketUpdateStats message,final MessageContext ctx){
  IThreadListener mainThread=Minecraft.getMinecraft();
  mainThread.addScheduledTask(new Runnable(){
    @Override public void run(){
      EntityPlayer player=Minecraft.getMinecraft().player;
      Stats statsCap=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        statsCap.setMaxMana(message.maxMana);
        statsCap.setMana(message.mana);
        statsCap.setManaPerSecond(message.manaPerSecond);
        statsCap.setMagicalPower(message.magicalPower);
        statsCap.setHealthPerSecond(message.healthPerSecond);
        statsCap.setCriticalChance(message.criticalChance);
        statsCap.setCriticalDamage(message.criticalDamage);
      }
    }
  }
);
  return null;
}
Program: 174616
Project: 174616
Buggy source:
@Override public void run(){
  EntityPlayer player=Minecraft.getMinecraft().player;
  Stats statsCap=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
  if (statsCap != null) {
    statsCap.setMana(message.mana);
    statsCap.setMaxMana(message.maxMana);
    statsCap.setManaPerSecond(message.manaPerSecond);
    statsCap.setMagicalPower(message.magicalPower);
    statsCap.setHealthPerSecond(message.healthPerSecond);
    statsCap.setCriticalChance(message.criticalChance);
    statsCap.setCriticalDamage(message.criticalDamage);
  }
}

Fixed version (ground truth):
@Override public void run(){
  EntityPlayer player=Minecraft.getMinecraft().player;
  Stats statsCap=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
  if (statsCap != null) {
    statsCap.setMaxMana(message.maxMana);
    statsCap.setMana(message.mana);
    statsCap.setManaPerSecond(message.manaPerSecond);
    statsCap.setMagicalPower(message.magicalPower);
    statsCap.setHealthPerSecond(message.healthPerSecond);
    statsCap.setCriticalChance(message.criticalChance);
    statsCap.setCriticalDamage(message.criticalDamage);
  }
}
Program: 174617
Project: 174617
Buggy source:
/** 
 * Set the type of the item to NBT for use in generating names. 
 */
public static void setTypes(ItemStack stack,NBTTagCompound nbt){
  if (stack.getItem() instanceof ItemSword) {
    if (stack.getItem() instanceof ItemMelee) {
      ItemMelee item=(ItemMelee)stack.getItem();
      nbt.setString("String_Node_Str",item.getType());
    }
 else     nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemArmor) {
    if (((ItemArmor)stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.HEAD)     nbt.setString("String_Node_Str","String_Node_Str");
 else     if (((ItemArmor)stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.CHEST)     nbt.setString("String_Node_Str","String_Node_Str");
 else     if (((ItemArmor)stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.LEGS)     nbt.setString("String_Node_Str","String_Node_Str");
 else     if (((ItemArmor)stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.FEET)     nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemBow) {
    nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemMagical) {
    nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemBauble) {
    ItemBauble item=(ItemBauble)stack.getItem();
    nbt.setString("String_Node_Str",item.getBaubleType(stack).toString().toLowerCase());
  }
}

Fixed version (ground truth):
/** 
 * Set the type of the item to NBT for use in generating names. 
 */
public static void setTypes(ItemStack stack,NBTTagCompound nbt){
  if (stack.getItem() instanceof ItemSword) {
    if (stack.getItem() instanceof ItemMelee) {
      ItemMelee item=(ItemMelee)stack.getItem();
      nbt.setString("String_Node_Str",item.getType());
    }
 else     nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemArmor) {
    if (((ItemArmor)stack.getItem()).armorType == EntityEquipmentSlot.HEAD)     nbt.setString("String_Node_Str","String_Node_Str");
 else     if (((ItemArmor)stack.getItem()).armorType == EntityEquipmentSlot.CHEST)     nbt.setString("String_Node_Str","String_Node_Str");
 else     if (((ItemArmor)stack.getItem()).armorType == EntityEquipmentSlot.LEGS)     nbt.setString("String_Node_Str","String_Node_Str");
 else     if (((ItemArmor)stack.getItem()).armorType == EntityEquipmentSlot.FEET)     nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemBow) {
    nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemMagical) {
    nbt.setString("String_Node_Str","String_Node_Str");
  }
 else   if (stack.getItem() instanceof ItemBauble) {
    ItemBauble item=(ItemBauble)stack.getItem();
    nbt.setString("String_Node_Str",item.getBaubleType(stack).toString().toLowerCase());
  }
}
Program: 174618
Project: 174618
Buggy source:
@Override public void onLivingUpdate(){
  if (!this.world.isRemote && this.getHeldItemMainhand() == null) {
    LootSlashConquer.LOGGER.info("String_Node_Str");
    this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,this.getRandomWeapon());
  }
}

Fixed version (ground truth):
@Override public void onLivingUpdate(){
  super.onLivingUpdate();
  if (!this.world.isRemote && this.getHeldItemMainhand() == null) {
    LootSlashConquer.LOGGER.info("String_Node_Str");
    this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,this.getRandomWeapon());
  }
}
Program: 174619
Project: 174619
Buggy source:
@SubscribeEvent public static void attachCapabilities(AttachCapabilitiesEvent<Entity> event){
  if (event.getObject() instanceof EntityPlayer) {
    final CurrentAbilities currentAbilities=new CurrentAbilities((EntityPlayer)event.getObject());
    event.addCapability(ID,createProvider(currentAbilities));
  }
}

Fixed version (ground truth):
public static void attachCapabilities(AttachCapabilitiesEvent<Entity> event){
  if (event.getObject() instanceof EntityPlayer) {
    final CurrentAbilities currentAbilities=new CurrentAbilities((EntityPlayer)event.getObject());
    event.addCapability(ID,createProvider(currentAbilities));
  }
}
Program: 174620
Project: 174620
Buggy source:
@SubscribeEvent public void onInput(InputEvent event){
  KeyBinding p=ClientProxy.bindingP;
  EntityPlayer player=Minecraft.getMinecraft().player;
  if (player != null && p.isPressed()) {
    player.openGui(LootSlashConquer.instance,GuiHandler.PLAYER_INFORMATION,player.getEntityWorld(),player.getPosition().getX(),player.getPosition().getY(),player.getPosition().getZ());
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onInput(InputEvent event){
  KeyBinding p=ClientProxy.bindingP;
  EntityPlayer player=Minecraft.getMinecraft().player;
  if (player != null && p.isPressed()) {
    player.openGui(LootSlashConquer.instance,GuiHandler.PLAYER_INFORMATION,player.getEntityWorld(),player.getPosition().getX(),player.getPosition().getY(),player.getPosition().getZ());
  }
  if (ClientProxy.openClass.isPressed()) {
    PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
    if (playerInfo != null && playerInfo.getPlayerClass() == 0) {
      player.openGui(LootSlashConquer.instance,GuiHandler.CLASS_SELECTION,player.getEntityWorld(),player.getPosition().getX(),player.getPosition().getY(),player.getPosition().getZ());
    }
  }
}
Program: 174621
Project: 174621
Buggy source:
@SubscribeEvent public void onRenderLiving(RenderLivingEvent.Post<EntityLivingBase> event){
  EntityLivingBase entity=event.getEntity();
  EnemyInfo enemyInfo=(EnemyInfo)entity.getCapability(CapabilityEnemyInfo.ENEMY_INFO,null);
  if (entity instanceof IMob && enemyInfo != null) {
    Entity viewingEntity=event.getRenderer().getRenderManager().renderViewEntity;
    double entityX=(entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)event.getPartialRenderTick());
    double entityY=(entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)event.getPartialRenderTick());
    double entityZ=(entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)event.getPartialRenderTick());
    double viewingX=(viewingEntity.lastTickPosX + (viewingEntity.posX - viewingEntity.lastTickPosX) * (double)event.getPartialRenderTick());
    double viewingY=(viewingEntity.lastTickPosY + (viewingEntity.posY - viewingEntity.lastTickPosY) * (double)event.getPartialRenderTick());
    double viewingZ=(viewingEntity.lastTickPosZ + (viewingEntity.posZ - viewingEntity.lastTickPosZ) * (double)event.getPartialRenderTick());
    double x=entityX - viewingX;
    double y=entityY - viewingY;
    double z=entityZ - viewingZ;
    String test=EnemyTier.getEnemyTier(enemyInfo).getColor() + EnemyTier.getEnemyTier(enemyInfo).getName() + "String_Node_Str"+ enemyInfo.getEnemyLevel();
    if (!entity.isInvisible()) {
      this.renderNameplate(entity,event.getRenderer().getRenderManager(),test,x,y + entity.height + 0.5,z,16);
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onRenderLiving(RenderLivingEvent.Post<EntityLivingBase> event){
  EntityLivingBase entity=event.getEntity();
  EnemyInfo enemyInfo=(EnemyInfo)entity.getCapability(CapabilityEnemyInfo.ENEMY_INFO,null);
  if (entity instanceof IMob && enemyInfo != null) {
    Entity viewingEntity=event.getRenderer().getRenderManager().renderViewEntity;
    double entityX=(entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)event.getPartialRenderTick());
    double entityY=(entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)event.getPartialRenderTick());
    double entityZ=(entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)event.getPartialRenderTick());
    double viewingX=(viewingEntity.lastTickPosX + (viewingEntity.posX - viewingEntity.lastTickPosX) * (double)event.getPartialRenderTick());
    double viewingY=(viewingEntity.lastTickPosY + (viewingEntity.posY - viewingEntity.lastTickPosY) * (double)event.getPartialRenderTick());
    double viewingZ=(viewingEntity.lastTickPosZ + (viewingEntity.posZ - viewingEntity.lastTickPosZ) * (double)event.getPartialRenderTick());
    double x=entityX - viewingX;
    double y=entityY - viewingY;
    double z=entityZ - viewingZ;
    String test=EnemyTier.getEnemyTier(enemyInfo).getColor() + EnemyTier.getEnemyTier(enemyInfo).getName() + "String_Node_Str"+ enemyInfo.getEnemyLevel();
    if (!entity.isInvisible()) {
      renderNameplate(entity,event.getRenderer().getRenderManager(),test,x,y + entity.height + 0.5,z,16);
    }
  }
}
Program: 174622
Project: 174622
Buggy source:
/** 
 * Renders text above an entity to show their level and tier.
 * @param entity
 * @param render
 * @param str
 * @param x
 * @param y
 * @param z
 * @param maxDistance
 */
private void renderNameplate(EntityLivingBase entity,RenderManager render,String str,double x,double y,double z,int maxDistance){
  double distance=entity.getDistance(render.renderViewEntity);
  if (distance > maxDistance)   return;
  FontRenderer font=render.getFontRenderer();
  float playerYaw=render.playerViewY;
  float playerPitch=render.playerViewX;
  EntityRenderer.drawNameplate(font,str,(float)x,(float)y,(float)z,0,playerYaw,playerPitch,false,false);
}

Fixed version (ground truth):
/** 
 * Renders text above an entity to show their level and tier.
 * @param entity
 * @param render
 * @param str
 * @param x
 * @param y
 * @param z
 * @param maxDistance
 */
private static void renderNameplate(EntityLivingBase entity,RenderManager render,String str,double x,double y,double z,int maxDistance){
  double distance=entity.getDistance(render.renderViewEntity);
  if (distance > maxDistance)   return;
  FontRenderer font=render.getFontRenderer();
  float playerYaw=render.playerViewY;
  float playerPitch=render.playerViewX;
  EntityRenderer.drawNameplate(font,str,(float)x,(float)y,(float)z,0,playerYaw,playerPitch,false,false);
}
Program: 174623
Project: 174623
Buggy source:
@SubscribeEvent public void onRenderOverlayText(RenderGameOverlayEvent.Text event){
  EntityPlayer player=Minecraft.getMinecraft().player;
  World world=Minecraft.getMinecraft().world;
  IChunkLevelHolder chunkLevelHolder=world.getCapability(CapabilityChunkLevel.CHUNK_LEVEL,null);
  IChunkLevel chunkLevel=chunkLevelHolder.getChunkLevel(new ChunkPos(player.getPosition()));
  if (chunkLevelHolder != null && chunkLevel != null) {
    Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("String_Node_Str" + chunkLevel.getChunkLevel(),10,10,0xFFFFFF);
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onRenderOverlayText(RenderGameOverlayEvent.Text event){
  EntityPlayer player=Minecraft.getMinecraft().player;
  World world=Minecraft.getMinecraft().world;
  IChunkLevelHolder chunkLevelHolder=world.getCapability(CapabilityChunkLevel.CHUNK_LEVEL,null);
  IChunkLevel chunkLevel=chunkLevelHolder.getChunkLevel(new ChunkPos(player.getPosition()));
  if (chunkLevelHolder != null && chunkLevel != null) {
    Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("String_Node_Str" + chunkLevel.getChunkLevel(),10,10,0xFFFFFF);
  }
}
Program: 174624
Project: 174624
Buggy source:
@SubscribeEvent public void onRenderPlayer(RenderPlayerEvent.Pre event){
  if (event.getEntityPlayer().isInvisible()) {
    event.setCanceled(true);
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre event){
  if (event.getEntityPlayer().isInvisible()) {
    event.setCanceled(true);
  }
}
Program: 174625
Project: 174625
Buggy source:
private void registerItemModel(Item item){
  ModelLoader.setCustomModelResourceLocation(item,0,new ModelResourceLocation(item.getRegistryName(),"String_Node_Str"));
}

Fixed version (ground truth):
private static void registerItemModel(Item item){
  ModelLoader.setCustomModelResourceLocation(item,0,new ModelResourceLocation(item.getRegistryName(),"String_Node_Str"));
}
Program: 174626
Project: 174626
Buggy source:
@SubscribeEvent public static void onPlayerTick(PlayerTickEvent event){
  if (event.phase == Phase.START && !event.player.getEntityWorld().isRemote) {
    if (ticks % 10 == 0) {
      PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
      if (event.player != null && playerInfo != null) {
        updateStats(event.player,playerInfo,4);
      }
      ticks=0;
    }
    if (regenTicks % 100 == 0) {
      Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        if (statsCap.getMana() < statsCap.getMaxMana()) {
          statsCap.increaseMana(statsCap.getManaPerSecond());
        }
        if (event.player.getHealth() < event.player.getMaxHealth()) {
          event.player.heal(statsCap.getHealthPerSecond());
        }
        LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
      }
      regenTicks=0;
    }
    ticks++;
    regenTicks++;
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onPlayerTick(PlayerTickEvent event){
  if (event.phase == Phase.START && !event.player.getEntityWorld().isRemote) {
    ticks++;
    regenTicks++;
    if (ticks % 10 == 0) {
      PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
      if (event.player != null && playerInfo != null) {
        updateStats(event.player,playerInfo,4);
      }
      ticks=0;
    }
    if (regenTicks % 100 == 0) {
      Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        if (statsCap.getMana() < statsCap.getMaxMana()) {
          statsCap.increaseMana(statsCap.getManaPerSecond());
        }
        if (event.player.getHealth() < event.player.getMaxHealth()) {
          event.player.heal(statsCap.getHealthPerSecond());
        }
        LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
      }
      regenTicks=0;
    }
  }
}
Program: 174627
Project: 174627
Buggy source:
@Override public void init(FMLInitializationEvent event){
  bindingP=new KeyBinding("String_Node_Str",Keyboard.KEY_P,"String_Node_Str");
  ClientRegistry.registerKeyBinding(bindingP);
}

Fixed version (ground truth):
@Override public void init(FMLInitializationEvent event){
  bindingP=new KeyBinding("String_Node_Str",Keyboard.KEY_P,"String_Node_Str");
  openClass=new KeyBinding("String_Node_Str",Keyboard.KEY_O,"String_Node_Str");
  ClientRegistry.registerKeyBinding(bindingP);
  ClientRegistry.registerKeyBinding(openClass);
}
Program: 174628
Project: 174628
Buggy source:
@Override public void preInit(FMLPreInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new ModItemModels());
  MinecraftForge.EVENT_BUS.register(new GuiMana());
  MinecraftForge.EVENT_BUS.register(new GuiHealth());
  MinecraftForge.EVENT_BUS.register(new EventRenderOverlayText());
  MinecraftForge.EVENT_BUS.register(new EventInput());
  MinecraftForge.EVENT_BUS.register(new EventItemTooltip());
  MinecraftForge.EVENT_BUS.register(new EventRenderPlayer());
  MinecraftForge.EVENT_BUS.register(new EventRenderLiving());
  registerRenderers();
}

Fixed version (ground truth):
@Override public void preInit(FMLPreInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new GuiMana());
  MinecraftForge.EVENT_BUS.register(new GuiHealth());
  registerRenderers();
}
Program: 174629
Project: 174629
Buggy source:
@Override public void onDeath(DamageSource cause){
  super.onDeath(cause);
  if (this.getHeldItemMainhand() != null) {
    this.entityDropItem(this.getHeldItemMainhand(),0);
  }
}

Fixed version (ground truth):
@Override public void onDeath(DamageSource cause){
  super.onDeath(cause);
  if (!this.world.isRemote && this.getHeldItemMainhand() != null) {
    this.entityDropItem(this.getHeldItemMainhand(),0);
  }
}
Program: 174630
Project: 174630
Buggy source:
public EntityBarbarian(World world){
  super(world);
  this.setSize(1.0F,2.0F);
}

Fixed version (ground truth):
public EntityBarbarian(World world){
  super(world);
  this.setSize(1.0F,2.0F);
  this.initEntityAI();
}
Program: 174632
Project: 174632
Buggy source:
/** 
 * Called to give the Barbarian a random melee weapon.
 */
@Override protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty){
  this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,this.getRandomWeapon());
}

Fixed version (ground truth):
/** 
 * Called to give the Barbarian a random melee weapon.
 */
@Override protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty){
  LootSlashConquer.LOGGER.info("String_Node_Str");
  this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,this.getRandomWeapon());
}
Program: 174633
Project: 174633
Buggy source:
@Override public boolean attackEntityAsMob(Entity enemy){
  ItemStack stack=this.getHeldItemMainhand();
  if (stack != null) {
    NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
    double damage=Math.random() * (nbt.getInteger("String_Node_Str") - nbt.getInteger("String_Node_Str")) + nbt.getInteger("String_Node_Str");
    boolean hasAttacked=enemy.attackEntityFrom(DamageSource.causeMobDamage(this),(float)damage);
    if (hasAttacked && enemy instanceof EntityLivingBase) {
      WeaponHelper.useWeaponAttributes((float)damage,this,(EntityLivingBase)enemy,stack,nbt);
      int knockback=EnchantmentHelper.getKnockbackModifier(this);
      if (knockback > 0) {
        ((EntityLivingBase)enemy).knockBack(this,(float)knockback * 0.5F,(double)MathHelper.sin(this.rotationYaw * 0.017453292F),(double)(-MathHelper.cos(this.rotationYaw * 0.017453292F)));
        this.motionX*=0.6D;
        this.motionZ*=0.6D;
      }
    }
    return hasAttacked;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean attackEntityAsMob(Entity entity){
  ItemStack stack=this.getHeldItemMainhand();
  if (stack != null && entity instanceof EntityPlayer) {
    EntityPlayer enemy=(EntityPlayer)entity;
    NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
    double damage=Math.random() * (nbt.getInteger("String_Node_Str") - nbt.getInteger("String_Node_Str")) + nbt.getInteger("String_Node_Str");
    boolean hasAttacked=enemy.attackEntityFrom(DamageSource.causeMobDamage(this),(float)damage);
    LootSlashConquer.LOGGER.info("String_Node_Str" + damage);
    if (hasAttacked) {
      LootSlashConquer.LOGGER.info("String_Node_Str");
      WeaponHelper.useWeaponAttributes((float)damage,this,(EntityLivingBase)enemy,stack,nbt);
      int knockback=EnchantmentHelper.getKnockbackModifier(this);
      if (knockback > 0) {
        ((EntityLivingBase)enemy).knockBack(this,(float)knockback * 0.5F,(double)MathHelper.sin(this.rotationYaw * 0.017453292F),(double)(-MathHelper.cos(this.rotationYaw * 0.017453292F)));
        this.motionX*=0.6D;
        this.motionZ*=0.6D;
      }
    }
    return hasAttacked;
  }
 else {
    return false;
  }
}
Program: 174634
Project: 174634
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static void registerModProjectile(Class entityClass,String name){
  EntityRegistry.registerModEntity(new ResourceLocation(Reference.MODID,name),entityClass,name,id,LootSlashConquer.instance,64,10,true);
}

Fixed version (ground truth):
private static void registerModProjectile(Class<? extends Entity> entityClass,String name){
  EntityRegistry.registerModEntity(new ResourceLocation(Reference.MODID,name),entityClass,name,++id,LootSlashConquer.instance,64,10,true);
}
Program: 174635
Project: 174635
Buggy source:
public static void registerEntities(){
  registerModProjectile(EntityFireball.class,"String_Node_Str");
  registerModProjectile(EntityIcebolt.class,"String_Node_Str");
  registerModProjectile(EntityLightning.class,"String_Node_Str");
}

Fixed version (ground truth):
public static void registerEntities(){
  registerModProjectile(EntityFireball.class,"String_Node_Str");
  registerModProjectile(EntityIcebolt.class,"String_Node_Str");
  registerModProjectile(EntityLightning.class,"String_Node_Str");
  registerModEntity(EntityBarbarian.class,"String_Node_Str");
  registerModEntity(EntityGhost.class,"String_Node_Str");
  registerModEntity(EntityMummy.class,"String_Node_Str");
  registerModEntity(EntityBandit.class,"String_Node_Str");
  registerModEntity(EntityBanshee.class,"String_Node_Str");
}
Program: 174636
Project: 174636
Buggy source:
@Override public ItemStack apply(ItemStack stack,Random rand,LootContext context){
  if (context instanceof CustomLootContext) {
    CustomLootContext customContext=(CustomLootContext)context;
    NBTTagCompound nbt;
    World world=context.getWorld();
    if (!stack.hasTagCompound())     nbt=new NBTTagCompound();
 else     nbt=stack.getTagCompound();
    if (customContext.getChestPos() != null) {
      BlockPos pos=customContext.getChestPos();
      ChunkPos chunkPos=new ChunkPos(pos);
      IChunkLevelHolder chunkLevelHolder=world.getCapability(CapabilityChunkLevel.CHUNK_LEVEL,null);
      IChunkLevel chunkLevel=chunkLevelHolder.getChunkLevel(chunkPos);
      nbt.setInteger("String_Node_Str",chunkLevel.getChunkLevel());
      stack.setTagCompound(nbt);
      return stack;
    }
 else {
      EntityLivingBase entity=(EntityLivingBase)customContext.getLootedEntity();
      EnemyInfo enemyLevel=(EnemyInfo)entity.getCapability(CapabilityEnemyInfo.ENEMY_INFO,null);
      nbt.setInteger("String_Node_Str",enemyLevel.getEnemyLevel());
      stack.setTagCompound(nbt);
      return stack;
    }
  }
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack apply(ItemStack stack,Random rand,LootContext context){
  if (context instanceof CustomLootContext) {
    CustomLootContext customContext=(CustomLootContext)context;
    NBTTagCompound nbt;
    World world=context.getWorld();
    if (!stack.hasTagCompound())     nbt=new NBTTagCompound();
 else     nbt=stack.getTagCompound();
    if (customContext.getChestPos() != null) {
      BlockPos pos=customContext.getChestPos();
      ChunkPos chunkPos=new ChunkPos(pos);
      IChunkLevelHolder chunkLevelHolder=world.getCapability(CapabilityChunkLevel.CHUNK_LEVEL,null);
      IChunkLevel chunkLevel=chunkLevelHolder.getChunkLevel(chunkPos);
      nbt.setInteger("String_Node_Str",chunkLevel.getChunkLevel());
      stack.setTagCompound(nbt);
      return stack;
    }
  }
 else {
    NBTTagCompound nbt;
    if (!stack.hasTagCompound())     nbt=new NBTTagCompound();
 else     nbt=stack.getTagCompound();
    EntityLivingBase entity=(EntityLivingBase)context.getLootedEntity();
    EnemyInfo enemyLevel=(EnemyInfo)entity.getCapability(CapabilityEnemyInfo.ENEMY_INFO,null);
    LootSlashConquer.LOGGER.info("String_Node_Str");
    nbt.setInteger("String_Node_Str",enemyLevel.getEnemyLevel());
    stack.setTagCompound(nbt);
    return stack;
  }
  LootSlashConquer.LOGGER.info("String_Node_Str");
  return stack;
}
Program: 174637
Project: 174637
Buggy source:
public ItemLEBauble(String name,BaubleType type){
  super();
  this.setRegistryName(Reference.MODID,name);
  this.setUnlocalizedName(name);
  this.setMaxStackSize(1);
  this.type=type;
}

Fixed version (ground truth):
public ItemLEBauble(String name,BaubleType type){
  super();
  this.setRegistryName(Reference.MODID,name);
  this.setUnlocalizedName(name);
  this.setCreativeTab(ModTabs.tabLE);
  this.setMaxStackSize(1);
  this.type=type;
}
Program: 174638
Project: 174638
Buggy source:
public ItemLEMagical(String name,boolean isStaff,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super();
  this.setRegistryName(Reference.MODID,name);
  this.setUnlocalizedName(name);
  this.setMaxStackSize(1);
  this.setNoRepair();
  this.setMaxDamage(durability);
  this.isStaff=isStaff;
  this.baseDamage=baseDamage;
  this.baseAttackSpeed=attackSpeed;
  this.manaPerUse=manaPerUse;
  this.addPropertyOverride(new ResourceLocation("String_Node_Str"),new IItemPropertyGetter(){
    @SideOnly(Side.CLIENT) public float apply(    ItemStack stack,    @Nullable World world,    @Nullable EntityLivingBase entity){
      if (entity instanceof EntityPlayer) {
        EntityPlayer player=(EntityPlayer)entity;
        NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
        PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
        if (playerInfo != null) {
          double attackSpeed=nbt.getDouble("String_Node_Str") + (PlayerStatHelper.ATTACK_SPEED_MULTIPLIER * (playerInfo.getTotalAgility()));
          return player.isHandActive() && player.getActiveItemStack() == stack && player.getItemInUseCount() < (stack.getMaxItemUseDuration() - (1 / attackSpeed) * 20) ? 1 : 0;
        }
      }
      return 0;
    }
  }
);
}

Fixed version (ground truth):
public ItemLEMagical(String name,boolean isStaff,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super();
  this.setRegistryName(Reference.MODID,name);
  this.setUnlocalizedName(name);
  this.setCreativeTab(ModTabs.tabLE);
  this.setMaxStackSize(1);
  this.setNoRepair();
  this.setMaxDamage(durability);
  this.isStaff=isStaff;
  this.baseDamage=baseDamage;
  this.baseAttackSpeed=attackSpeed;
  this.manaPerUse=manaPerUse;
  this.addPropertyOverride(new ResourceLocation("String_Node_Str"),new IItemPropertyGetter(){
    @SideOnly(Side.CLIENT) public float apply(    ItemStack stack,    @Nullable World world,    @Nullable EntityLivingBase entity){
      if (entity instanceof EntityPlayer) {
        EntityPlayer player=(EntityPlayer)entity;
        NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
        PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
        if (playerInfo != null) {
          double attackSpeed=nbt.getDouble("String_Node_Str") + (PlayerStatHelper.ATTACK_SPEED_MULTIPLIER * (playerInfo.getTotalAgility()));
          return player.isHandActive() && player.getActiveItemStack() == stack && player.getItemInUseCount() < (stack.getMaxItemUseDuration() - (1 / attackSpeed) * 20) ? 1 : 0;
        }
      }
      return 0;
    }
  }
);
}
Program: 174640
Project: 174640
Buggy source:
@Override public ActionResult<ItemStack> onItemRightClick(World world,EntityPlayer player,EnumHand hand){
  Stats statsCap=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
  PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  if (statsCap != null && playerInfo != null) {
    statsCap.setMana(50);
    if (statsCap.getMana() - this.manaPerUse >= 0 && playerInfo.getPlayerLevel() >= NBTHelper.loadStackNBT(player.inventory.getCurrentItem()).getInteger("String_Node_Str")) {
      player.setActiveHand(hand);
      return new ActionResult<ItemStack>(EnumActionResult.SUCCESS,player.inventory.getCurrentItem());
    }
  }
  player.sendMessage(new TextComponentString(TextFormatting.RED + "String_Node_Str"));
  return new ActionResult<ItemStack>(EnumActionResult.FAIL,player.inventory.getCurrentItem());
}

Fixed version (ground truth):
@Override public ActionResult<ItemStack> onItemRightClick(World world,EntityPlayer player,EnumHand hand){
  Stats statsCap=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
  PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  if (statsCap != null && playerInfo != null) {
    if (statsCap.getMana() - this.manaPerUse >= 0 && playerInfo.getPlayerLevel() >= NBTHelper.loadStackNBT(player.inventory.getCurrentItem()).getInteger("String_Node_Str")) {
      player.setActiveHand(hand);
      return new ActionResult<ItemStack>(EnumActionResult.SUCCESS,player.inventory.getCurrentItem());
    }
  }
  player.sendMessage(new TextComponentString(TextFormatting.RED + "String_Node_Str"));
  return new ActionResult<ItemStack>(EnumActionResult.FAIL,player.inventory.getCurrentItem());
}
Program: 174642
Project: 174642
Buggy source:
public static void setMinMaxDamage(NBTTagCompound nbt,double damage){
  double rangeMultiplier=(nbt.getInteger("String_Node_Str") + 1) * 0.25;
  int range=(int)((Math.random() * 4 + 2) * rangeMultiplier / 1.5);
  int minDamage=(int)(damage - range);
  int maxDamage=(int)(damage + range);
  if (minDamage == maxDamage)   minDamage-=1;
  if (WeaponAttribute.MIN_DAMAGE.hasAttribute(nbt))   minDamage+=WeaponAttribute.MIN_DAMAGE.getAmount(nbt);
 else   if (WeaponAttribute.MAX_DAMAGE.hasAttribute(nbt))   maxDamage+=WeaponAttribute.MAX_DAMAGE.getAmount(nbt);
  nbt.setInteger("String_Node_Str",minDamage);
  nbt.setInteger("String_Node_Str",maxDamage);
}

Fixed version (ground truth):
public static void setMinMaxDamage(NBTTagCompound nbt,double damage){
  double rangeMultiplier=(nbt.getInteger("String_Node_Str") + 1) * 0.25;
  int range=(int)((Math.random() * 4 + 2) * rangeMultiplier / 1.5);
  int minDamage=(int)(damage - range);
  int maxDamage=(int)(damage + range);
  if (minDamage == maxDamage)   minDamage-=1;
  while (minDamage > maxDamage)   maxDamage+=1;
  if (WeaponAttribute.MIN_DAMAGE.hasAttribute(nbt))   minDamage+=WeaponAttribute.MIN_DAMAGE.getAmount(nbt);
 else   if (WeaponAttribute.MAX_DAMAGE.hasAttribute(nbt))   maxDamage+=WeaponAttribute.MAX_DAMAGE.getAmount(nbt);
  nbt.setInteger("String_Node_Str",minDamage);
  nbt.setInteger("String_Node_Str",maxDamage);
}
Program: 174643
Project: 174643
Buggy source:
public static void registerEvents(){
  MinecraftForge.EVENT_BUS.register(new ModBlocks());
  MinecraftForge.EVENT_BUS.register(new ModItems());
  MinecraftForge.EVENT_BUS.register(new ModWeapons());
  MinecraftForge.EVENT_BUS.register(new EventPlayerLoggedIn());
  MinecraftForge.EVENT_BUS.register(new EventLivingDeath());
  MinecraftForge.EVENT_BUS.register(new EventInput());
  MinecraftForge.EVENT_BUS.register(new EventLivingHurtAttack());
  MinecraftForge.EVENT_BUS.register(new EventItemTooltip());
  MinecraftForge.EVENT_BUS.register(new EventLoadLootTable());
  MinecraftForge.EVENT_BUS.register(new EventPlayerTick());
  MinecraftForge.EVENT_BUS.register(new EventEntityJoinWorld());
  MinecraftForge.EVENT_BUS.register(new EventContainerOpen());
}

Fixed version (ground truth):
public static void registerEvents(){
  MinecraftForge.EVENT_BUS.register(new ModBlocks());
  MinecraftForge.EVENT_BUS.register(new ModItems());
  MinecraftForge.EVENT_BUS.register(new ModWeapons());
  MinecraftForge.EVENT_BUS.register(new EventPlayerLoggedIn());
  MinecraftForge.EVENT_BUS.register(new EventLivingDeath());
  MinecraftForge.EVENT_BUS.register(new EventLivingHurtAttack());
  MinecraftForge.EVENT_BUS.register(new EventLoadLootTable());
  MinecraftForge.EVENT_BUS.register(new EventPlayerTick());
  MinecraftForge.EVENT_BUS.register(new EventEntityJoinWorld());
  MinecraftForge.EVENT_BUS.register(new EventContainerOpen());
}
Program: 174644
Project: 174644
Buggy source:
@Override public void preInit(FMLPreInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new ModItemModels());
  MinecraftForge.EVENT_BUS.register(new GuiMana());
  MinecraftForge.EVENT_BUS.register(new GuiHealth());
  MinecraftForge.EVENT_BUS.register(new EventRenderOverlayText());
}

Fixed version (ground truth):
@Override public void preInit(FMLPreInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new ModItemModels());
  MinecraftForge.EVENT_BUS.register(new GuiMana());
  MinecraftForge.EVENT_BUS.register(new GuiHealth());
  MinecraftForge.EVENT_BUS.register(new EventRenderOverlayText());
  MinecraftForge.EVENT_BUS.register(new EventInput());
  MinecraftForge.EVENT_BUS.register(new EventItemTooltip());
}
Program: 174645
Project: 174645
Buggy source:
public void procedurallyGenerate(TemplateManager manager,World world,BlockPos startingPos,ArrayList<PotentialPosition> potentialPositions){
  LostEclipse.LOGGER.debug("String_Node_Str");
  LostEclipse.LOGGER.debug("String_Node_Str" + depth + "String_Node_Str"+ roomCount);
  ArrayList<PotentialPosition> nextPositions=potentialPositions;
  if (depth > maxDepth)   return;
 else {
    if (roomCount == 0) {
      int y=-8 * depth;
      if (depth == 1)       y-=5;
      nextPositions=generateStaircase(manager,world,startingPos.add(0,y,0));
    }
 else {
      nextPositions=generateRooms(manager,world,potentialPositions,depth);
    }
  }
  roomCount++;
  if (roomCount == maxRoomsPerDepth) {
    depth++;
    roomCount=0;
    nextPositions=null;
  }
  procedurallyGenerate(manager,world,startingPos,nextPositions);
}

Fixed version (ground truth):
public void procedurallyGenerate(TemplateManager manager,World world,BlockPos startingPos,ArrayList<PotentialPosition> potentialPositions){
  LostEclipse.LOGGER.debug("String_Node_Str");
  LostEclipse.LOGGER.debug("String_Node_Str" + depth + "String_Node_Str"+ roomCount);
  ArrayList<PotentialPosition> nextPositions=potentialPositions;
  if (depth > maxDepth)   return;
 else {
    if (roomCount == 0) {
      int y=-14;
      if (depth > 1)       y-=8 * depth;
      nextPositions=generateStaircase(manager,world,startingPos.add(0,y,0));
    }
 else {
      nextPositions=generateRooms(manager,world,potentialPositions,depth);
    }
  }
  roomCount++;
  if (roomCount == maxRoomsPerDepth) {
    depth++;
    roomCount=0;
    nextPositions=null;
  }
  procedurallyGenerate(manager,world,startingPos,nextPositions);
}
Program: 174646
Project: 174646
Buggy source:
@SubscribeEvent public void playerClone(PlayerEvent.Clone event){
  IPlayerInformation oldInfo=getPlayerInformation(event.getOriginal());
  IPlayerInformation newInfo=getPlayerInformation(event.getEntityLiving());
  if (newInfo != null && oldInfo != null) {
    newInfo.setPlayerClass(oldInfo.getPlayerClass());
    newInfo.setPlayerLevel(oldInfo.getPlayerLevel());
    newInfo.setPlayerExperience(oldInfo.getPlayerExperience());
    newInfo.setSkillPoints(oldInfo.getSkillPoints());
    newInfo.setStrengthStat(oldInfo.getStrengthStat());
    newInfo.setAgilityStat(oldInfo.getAgilityStat());
    newInfo.setDexterityStat(oldInfo.getDexterityStat());
    newInfo.setIntelligenceStat(oldInfo.getIntelligenceStat());
    newInfo.setWisdomStat(oldInfo.getWisdomStat());
    newInfo.setFortitudeStat(oldInfo.getFortitudeStat());
    newInfo.setBonusStrengthStat(oldInfo.getBonusStrengthStat());
    newInfo.setBonusAgilityStat(oldInfo.getBonusAgilityStat());
    newInfo.setBonusDexterityStat(oldInfo.getBonusDexterityStat());
    newInfo.setBonusIntelligenceStat(oldInfo.getBonusIntelligenceStat());
    newInfo.setBonusWisdomStat(oldInfo.getBonusWisdomStat());
    newInfo.setBonusFortitudeStat(oldInfo.getBonusFortitudeStat());
  }
}

Fixed version (ground truth):
@SubscribeEvent public void playerClone(PlayerEvent.Clone event){
  IPlayerInformation oldInfo=getPlayerInformation(event.getOriginal());
  IPlayerInformation newInfo=getPlayerInformation(event.getEntityLiving());
  if (newInfo != null && oldInfo != null) {
    newInfo.setPlayerClass(oldInfo.getPlayerClass());
    newInfo.setPlayerLevel(oldInfo.getPlayerLevel());
    newInfo.setPlayerExperience(oldInfo.getPlayerExperience());
    newInfo.setSkillPoints(oldInfo.getSkillPoints());
    newInfo.setStrengthStat(oldInfo.getStrengthStat());
    newInfo.setAgilityStat(oldInfo.getAgilityStat());
    newInfo.setDexterityStat(oldInfo.getDexterityStat());
    newInfo.setIntelligenceStat(oldInfo.getIntelligenceStat());
    newInfo.setWisdomStat(oldInfo.getWisdomStat());
    newInfo.setFortitudeStat(oldInfo.getFortitudeStat());
    newInfo.setBonusStrengthStat(oldInfo.getBonusStrengthStat());
    newInfo.setBonusAgilityStat(oldInfo.getBonusAgilityStat());
    newInfo.setBonusDexterityStat(oldInfo.getBonusDexterityStat());
    newInfo.setBonusIntelligenceStat(oldInfo.getBonusIntelligenceStat());
    newInfo.setBonusWisdomStat(oldInfo.getBonusWisdomStat());
    newInfo.setBonusFortitudeStat(oldInfo.getBonusFortitudeStat());
    LostEclipse.LOGGER.info("String_Node_Str");
    LostEclipse.network.sendTo(new PacketUpdatePlayerInformation((PlayerInformation)newInfo),(EntityPlayerMP)event.getEntityLiving());
  }
}
Program: 174648
Project: 174648
Buggy source:
@Override public IMessage onMessage(final PacketUpdatePlayerInformation message,final MessageContext ctx){
  IThreadListener mainThread=Minecraft.getMinecraft();
  mainThread.addScheduledTask(new Runnable(){
    @Override public void run(){
      EntityPlayer player=Minecraft.getMinecraft().player;
      PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
      if (playerInfo != null) {
        playerInfo.setPlayerClass(message.playerClass);
        playerInfo.setPlayerLevel(message.level);
        playerInfo.setPlayerExperience(message.experience);
        playerInfo.setSkillPoints(message.skillPoints);
      }
    }
  }
);
  return null;
}

Fixed version (ground truth):
@Override public IMessage onMessage(final PacketUpdatePlayerInformation message,final MessageContext ctx){
  IThreadListener mainThread=Minecraft.getMinecraft();
  mainThread.addScheduledTask(new Runnable(){
    @Override public void run(){
      EntityPlayer player=Minecraft.getMinecraft().player;
      PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
      if (playerInfo != null) {
        LostEclipse.LOGGER.info("String_Node_Str" + message.playerClass);
        playerInfo.setPlayerClass(message.playerClass);
        LostEclipse.LOGGER.info(playerInfo.getPlayerClass());
        playerInfo.setPlayerLevel(message.level);
        playerInfo.setPlayerExperience(message.experience);
        playerInfo.setSkillPoints(message.skillPoints);
      }
    }
  }
);
  return null;
}
Program: 174649
Project: 174649
Buggy source:
@Override public void run(){
  EntityPlayer player=Minecraft.getMinecraft().player;
  PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  if (playerInfo != null) {
    playerInfo.setPlayerClass(message.playerClass);
    playerInfo.setPlayerLevel(message.level);
    playerInfo.setPlayerExperience(message.experience);
    playerInfo.setSkillPoints(message.skillPoints);
  }
}

Fixed version (ground truth):
@Override public void run(){
  EntityPlayer player=Minecraft.getMinecraft().player;
  PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  if (playerInfo != null) {
    LostEclipse.LOGGER.info("String_Node_Str" + message.playerClass);
    playerInfo.setPlayerClass(message.playerClass);
    LostEclipse.LOGGER.info(playerInfo.getPlayerClass());
    playerInfo.setPlayerLevel(message.level);
    playerInfo.setPlayerExperience(message.experience);
    playerInfo.setSkillPoints(message.skillPoints);
  }
}
Program: 174650
Project: 174650
Buggy source:
public static ICapabilityProvider createProvider(IStats mana){
  return new SimpleCapabilityProvider<>(STATS,DEFAULT_FACING,mana);
}

Fixed version (ground truth):
public static ICapabilityProvider createProvider(IStats stats){
  return new SimpleCapabilityProvider<>(STATS,DEFAULT_FACING,stats);
}
Program: 174651
Project: 174651
Buggy source:
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityLivingBase) {
      result.entityHit.setFire(seconds);
    }
  }
}

Fixed version (ground truth):
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityLivingBase) {
      result.entityHit.setFire(seconds);
    }
    this.setDead();
  }
}
Program: 174652
Project: 174652
Buggy source:
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityLivingBase) {
      ((EntityLivingBase)result.entityHit).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS,20 * seconds,1));
    }
  }
}

Fixed version (ground truth):
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityLivingBase) {
      ((EntityLivingBase)result.entityHit).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS,20 * seconds,1));
    }
    this.setDead();
  }
}
Program: 174653
Project: 174653
Buggy source:
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityPlayer) {
      IStats statsCap=result.entityHit.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        statsCap.setMana(statsCap.getMana() - amount);
        if (statsCap.getMana() < 0)         statsCap.setMana(0);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityPlayer) {
      IStats statsCap=result.entityHit.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        statsCap.setMana(statsCap.getMana() - amount);
        if (statsCap.getMana() < 0)         statsCap.setMana(0);
      }
    }
    this.setDead();
  }
}
Program: 174654
Project: 174654
Buggy source:
@Override protected float getGravityVelocity(){
  return 0;
}

Fixed version (ground truth):
@Override protected float getGravityVelocity(){
  return 0F;
}
Program: 174655
Project: 174655
Buggy source:
@Override public void onUpdate(){
  super.onUpdate();
  if (this.getEntityWorld().isRemote) {
    if (!this.inGround && !this.isDead) {
      this.getEntityWorld().spawnParticle(EnumParticleTypes.SPELL_INSTANT,this.posX,this.posY,this.posZ,0F,0F,0F,new int[0]);
    }
    if (this.inGround) {
      this.setDead();
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  super.onUpdate();
  if (this.getEntityWorld().isRemote) {
    if (!this.inGround && !this.isDead) {
      this.getEntityWorld().spawnParticle(EnumParticleTypes.SPELL_INSTANT,this.posX,this.posY,this.posZ,0F,0F,0F,new int[0]);
    }
  }
}
Program: 174656
Project: 174656
Buggy source:
@Override public void preInit(FMLPreInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new ModItemModels());
  MinecraftForge.EVENT_BUS.register(new GuiMana());
}

Fixed version (ground truth):
@Override public void preInit(FMLPreInitializationEvent event){
  MinecraftForge.EVENT_BUS.register(new ModItemModels());
  MinecraftForge.EVENT_BUS.register(new GuiMana());
  MinecraftForge.EVENT_BUS.register(new GuiHealth());
}
Program: 174657
Project: 174657
Buggy source:
@Override public Object getClientGuiElement(int id,EntityPlayer player,World world,int x,int y,int z){
  if (id == CLASS_SELECTION)   return new GuiClassSelection();
  if (id == PLAYER_INFORMATION)   return new GuiPlayerInformation();
  if (id == MANA)   return new GuiMana();
  return null;
}

Fixed version (ground truth):
@Override public Object getClientGuiElement(int id,EntityPlayer player,World world,int x,int y,int z){
  if (id == CLASS_SELECTION)   return new GuiClassSelection();
  if (id == PLAYER_INFORMATION)   return new GuiPlayerInformation();
  if (id == MANA)   return new GuiMana();
  if (id == HEALTH)   return new GuiHealth();
  return null;
}
Program: 174658
Project: 174658
Buggy source:
public ItemLEMagical(String name,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super();
  this.setRegistryName(Reference.MODID,name);
  this.setUnlocalizedName(name);
  this.setMaxStackSize(1);
  this.setNoRepair();
  this.setMaxDamage(durability);
  this.baseDamage=baseDamage;
  this.baseAttackSpeed=attackSpeed;
  this.manaPerUse=manaPerUse;
}

Fixed version (ground truth):
public ItemLEMagical(String name,boolean isStaff,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super();
  this.setRegistryName(Reference.MODID,name);
  this.setUnlocalizedName(name);
  this.setMaxStackSize(1);
  this.setNoRepair();
  this.setMaxDamage(durability);
  this.isStaff=isStaff;
  this.baseDamage=baseDamage;
  this.baseAttackSpeed=attackSpeed;
  this.manaPerUse=manaPerUse;
}
Program: 174659
Project: 174659
Buggy source:
public ItemBlazefury(String name,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super(name,baseDamage,attackSpeed,manaPerUse,durability);
}

Fixed version (ground truth):
public ItemBlazefury(String name,boolean isStaff,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super(name,isStaff,baseDamage,attackSpeed,manaPerUse,durability);
}
Program: 174660
Project: 174660
Buggy source:
public ItemEpilogue(String name,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super(name,baseDamage,attackSpeed,manaPerUse,durability);
}

Fixed version (ground truth):
public ItemEpilogue(String name,boolean isStaff,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super(name,isStaff,baseDamage,attackSpeed,manaPerUse,durability);
}
Program: 174661
Project: 174661
Buggy source:
public ItemGazeOfTruth(String name,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super(name,baseDamage,attackSpeed,manaPerUse,durability);
}

Fixed version (ground truth):
public ItemGazeOfTruth(String name,boolean isStaff,double baseDamage,double attackSpeed,int manaPerUse,int durability){
  super(name,isStaff,baseDamage,attackSpeed,manaPerUse,durability);
}