nus-yam/ex-repair huggingface dataset:
Program: 174563
Project: 174563
Buggy source:
public RenderLapisLazuli(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelLapisLazuli(),0.25F);
  this.addLayer(new LayerLapisLazuliItem(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
}

Fixed version (ground truth):
public RenderLapisLazuli(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelLapisLazuli(),0.25F);
  this.addLayer(new LayerLapisLazuliItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerGemPlacement(this));
}
Program: 174564
Project: 174564
Buggy source:
public void travel(float strafe,float up,float forward){
  if (this.getGemPlacement() == GemPlacements.NOSE) {
    if (this.getAttackTarget() != null || this.getRevengeTarget() != null) {
      forward*=2;
      strafe*=2;
    }
  }
  if (this.dimensionOfCreation == -1) {
    if (this.motionY > 0) {
      this.motionY*=2.0;
    }
 else {
      this.motionY*=0.5;
    }
  }
  super.travel(strafe,up,forward);
}

Fixed version (ground truth):
public void travel(float strafe,float up,float forward){
  if (this.getGemPlacement() == GemPlacements.NOSE) {
    if (this.getAttackTarget() != null || this.getRevengeTarget() != null) {
      forward*=2;
      strafe*=2;
    }
  }
  super.travel(strafe,up,forward);
}
Program: 174565
Project: 174565
Buggy source:
/** 
 * Methods related to entity rendering.                  
 */
@SideOnly(Side.CLIENT) public int getBrightnessForRender(float partialTicks){
  return this.isSpaceBorn ? 15728880 : super.getBrightnessForRender(partialTicks);
}

Fixed version (ground truth):
/** 
 * Methods related to entity rendering.				  
 */
@SideOnly(Side.CLIENT) public int getBrightnessForRender(float partialTicks){
  return this.isSpaceBorn ? 15728880 : super.getBrightnessForRender(partialTicks);
}
Program: 174566
Project: 174566
Buggy source:
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty,IEntityLivingData livingdata){
  this.setHealth(this.getMaxHealth());
  if (!this.isGemPlacementDefined() || !this.isCorrectGemPlacement()) {
    int placementIndex=this.rand.nextInt(this.placements.size());
    this.setGemPlacement(this.placements.get(placementIndex).id);
  }
  if (!this.isGemCutDefined() || !this.isCorrectGemCut()) {
    int cutIndex=this.rand.nextInt(this.cuts.size());
    this.setGemCut(this.cuts.get(cutIndex).id);
  }
  this.applyGemPlacementBuffs();
  this.setHasVisor(this.rand.nextInt(3) == 0);
  this.setDimensionOfCreation(this.dimension);
  this.setAttackAI();
  if (this.fallbackServitude == -1) {
    this.fallbackServitude=0;
  }
  this.pitch=0.7F + (this.rand.nextFloat() / 2);
  return super.onInitialSpawn(difficulty,livingdata);
}

Fixed version (ground truth):
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty,IEntityLivingData livingdata){
  this.setHealth(this.getMaxHealth());
  if (!this.isGemPlacementDefined() || !this.isGemCutDefined() || !this.isCorrectCutPlacement()) {
    this.setNewCutPlacement();
  }
  this.applyGemPlacementBuffs();
  this.setHasVisor(this.rand.nextInt(3) == 0);
  this.setDimensionOfCreation(this.dimension);
  this.setAttackAI();
  if (this.fallbackServitude == -1) {
    this.fallbackServitude=0;
  }
  this.pitch=0.7F + (this.rand.nextFloat() / 2);
  return super.onInitialSpawn(difficulty,livingdata);
}
Program: 174569
Project: 174569
Buggy source:
/** 
 * Methods related to entity combat.                     
 */
public boolean shouldAttackEntity(EntityLivingBase attacker,EntityLivingBase victim){
  return this.isOnSameTeam(victim);
}

Fixed version (ground truth):
/** 
 * Methods related to entity combat.					 
 */
public boolean shouldAttackEntity(EntityLivingBase attacker,EntityLivingBase victim){
  return this.isOnSameTeam(victim);
}
Program: 174570
Project: 174570
Buggy source:
/** 
 * Methods related to entity sound.                      
 */
public float getSoundPitch(){
  return this.pitch;
}

Fixed version (ground truth):
/** 
 * Methods related to entity sound.					  
 */
public float getSoundPitch(){
  return this.pitch;
}
Program: 174571
Project: 174571
Buggy source:
public boolean alternateInteract(EntityPlayer player){
  return false;
}

Fixed version (ground truth):
public boolean alternateInteract(EntityPlayer player){
  KAGIC.instance.chatInfoMessage("String_Node_Str" + this.getGemCut() + "String_Node_Str"+ this.getGemPlacement());
  return false;
}
Program: 174573
Project: 174573
Buggy source:
/** 
 * Methods related to entity rendering.                  
 */
@SideOnly(Side.CLIENT) public void handleStatusUpdate(byte id){
  if (id == 7) {
    this.playTameEffect();
  }
 else {
    super.handleStatusUpdate(id);
  }
}

Fixed version (ground truth):
/** 
 * Methods related to entity rendering.				  
 */
@SideOnly(Side.CLIENT) public void handleStatusUpdate(byte id){
  if (id == 7) {
    this.playTameEffect();
  }
 else {
    super.handleStatusUpdate(id);
  }
}
Program: 174575
Project: 174575
Buggy source:
/** 
 * Methods related to entity living.                     
 */
public void onLivingUpdate(){
  if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.getAttackTarget() instanceof EntityPlayer) {
    this.setAttackTarget(null);
  }
  if (this.isPeaceful) {
    this.setAttackTarget(null);
    this.isPeaceful=false;
  }
  if (this.isDefective()) {
    this.whenDefective();
  }
  if (this.fallbackServitude > 0) {
    if (this.timeUntilBetrayal > (this.rand.nextDouble() * 4) * 24000) {
      this.servitude=this.fallbackServitude;
    }
    ++this.timeUntilBetrayal;
  }
  super.onLivingUpdate();
}

Fixed version (ground truth):
/** 
 * Methods related to entity living.					 
 */
public void onLivingUpdate(){
  if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.getAttackTarget() instanceof EntityPlayer) {
    this.setAttackTarget(null);
  }
  if (this.isPeaceful) {
    this.setAttackTarget(null);
    this.isPeaceful=false;
  }
  if (this.isDefective()) {
    this.whenDefective();
  }
  if (this.fallbackServitude > 0) {
    if (this.timeUntilBetrayal > (this.rand.nextDouble() * 4) * 24000) {
      this.servitude=this.fallbackServitude;
    }
    ++this.timeUntilBetrayal;
  }
  super.onLivingUpdate();
}
Program: 174576
Project: 174576
Buggy source:
protected boolean shouldMoveTo(World world,BlockPos pos){
  Block block=world.getBlockState(pos).getBlock();
  BlockPos cropPos=pos.up();
  IBlockState iblockstate=world.getBlockState(cropPos);
  Block crop=iblockstate.getBlock();
  if (block == Blocks.FARMLAND) {
    if (crop instanceof BlockBeetroot) {
      if (iblockstate.getValue(BlockBeetroot.BEETROOT_AGE) >= 3 && (this.currentTask == 0 || this.currentTask < 0)) {
        this.currentTask=0;
        return true;
      }
    }
 else     if (crop instanceof BlockCrops && iblockstate.getValue(BlockCrops.AGE) >= 7 && (this.currentTask == 0 || this.currentTask < 0)) {
      this.currentTask=0;
      return true;
    }
  }
 else   if (block == Blocks.SOUL_SAND) {
    if (crop instanceof BlockNetherWart && iblockstate.getValue(BlockNetherWart.AGE) >= 3 && (this.currentTask == 0 || this.currentTask < 0)) {
      this.currentTask=0;
      return true;
    }
  }
  if (iblockstate.getMaterial() == Material.AIR && (this.currentTask == 1 || this.currentTask < 0)) {
    this.currentTask=1;
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected boolean shouldMoveTo(World world,BlockPos pos){
  Block block=world.getBlockState(pos).getBlock();
  BlockPos cropPos=pos.up();
  IBlockState iblockstate=world.getBlockState(cropPos);
  Block crop=iblockstate.getBlock();
  if (block == Blocks.FARMLAND) {
    if (crop instanceof BlockBeetroot) {
      if (iblockstate.getValue(BlockBeetroot.BEETROOT_AGE) >= 3 && (this.currentTask == 0 || this.currentTask < 0)) {
        this.currentTask=0;
        return true;
      }
    }
 else     if (crop instanceof BlockCrops && iblockstate.getValue(BlockCrops.AGE) >= 7 && (this.currentTask == 0 || this.currentTask < 0)) {
      this.currentTask=0;
      return true;
    }
  }
 else   if (block == Blocks.SOUL_SAND) {
    if (crop instanceof BlockNetherWart && iblockstate.getValue(BlockNetherWart.AGE) >= 3 && (this.currentTask == 0 || this.currentTask < 0)) {
      this.currentTask=0;
      return true;
    }
  }
  if (iblockstate.getMaterial() == Material.AIR && (this.currentTask == 1 || this.currentTask < 0)) {
    if (block == Blocks.FARMLAND && this.hasSeeds()) {
      this.currentTask=1;
      return true;
    }
 else     if (block == Blocks.SOUL_SAND && this.hasNetherWart()) {
      this.currentTask=1;
      return true;
    }
  }
  return false;
}
Program: 174580
Project: 174580
Buggy source:
public EntityBismuth(World worldIn){
  super(worldIn);
  this.isImmuneToFire=true;
  this.setSize(0.9F,2.3F);
  this.setValidCut(GemCuts.BISMUTH);
  this.setValidPlacement(GemPlacements.BACK_OF_HEAD);
  this.setValidPlacement(GemPlacements.BACK);
  this.setValidPlacement(GemPlacements.CHEST);
  this.setValidPlacement(GemPlacements.BELLY);
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(1,new EntityAIFollowDiamond(this,1.0D));
  this.tasks.addTask(2,new EntityAIRestrictOpenDoor(this));
  this.tasks.addTask(3,new EntityAIMoveTowardsTarget(this,0.414D,32.0F));
  this.tasks.addTask(3,new EntityAIAttackMelee(this,1.0d,true));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityPlayer.class,16.0F));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityMob.class,16.0F));
  this.tasks.addTask(5,new EntityAIStandGuard(this,0.6D));
  this.tasks.addTask(6,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIHurtByTarget(this,false,new Class[0]));
  this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(200.0D);
  this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(18.0D);
  this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D);
  this.droppedGemItem=ModItems.BISMUTH_GEM;
  this.droppedCrackedGemItem=ModItems.CRACKED_BISMUTH_GEM;
}

Fixed version (ground truth):
public EntityBismuth(World worldIn){
  super(worldIn);
  this.isImmuneToFire=true;
  this.setSize(0.9F,2.3F);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BACK_OF_HEAD);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BACK);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.CHEST);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BELLY);
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(1,new EntityAIFollowDiamond(this,1.0D));
  this.tasks.addTask(2,new EntityAIRestrictOpenDoor(this));
  this.tasks.addTask(3,new EntityAIMoveTowardsTarget(this,0.414D,32.0F));
  this.tasks.addTask(3,new EntityAIAttackMelee(this,1.0d,true));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityPlayer.class,16.0F));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityMob.class,16.0F));
  this.tasks.addTask(5,new EntityAIStandGuard(this,0.6D));
  this.tasks.addTask(6,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIHurtByTarget(this,false,new Class[0]));
  this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(200.0D);
  this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(18.0D);
  this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D);
  this.droppedGemItem=ModItems.BISMUTH_GEM;
  this.droppedCrackedGemItem=ModItems.CRACKED_BISMUTH_GEM;
}
Program: 174584
Project: 174584
Buggy source:
public EntityPadparadscha(World worldIn){
  super(worldIn);
  this.setSize(0.7F,1.6F);
  this.seePastDoors();
  this.setValidCut(GemCuts.FACETED);
  this.setValidPlacement(GemPlacements.BACK_OF_HEAD);
  this.setValidPlacement(GemPlacements.FOREHEAD);
  this.setValidPlacement(GemPlacements.LEFT_EYE);
  this.setValidPlacement(GemPlacements.RIGHT_EYE);
  this.setValidPlacement(GemPlacements.LEFT_CHEEK);
  this.setValidPlacement(GemPlacements.RIGHT_CHEEK);
  this.setValidPlacement(GemPlacements.BACK);
  this.setValidPlacement(GemPlacements.CHEST);
  this.setValidPlacement(GemPlacements.BELLY);
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(1,new EntityAIFollowDiamond(this,1.0D));
  this.tasks.addTask(2,new EntityAIRetroVision(this));
  this.tasks.addTask(3,new EntityAIOpenDoor(this,true));
  this.tasks.addTask(4,new EntityAIWander(this,0.6D));
  this.tasks.addTask(5,new EntityAILookIdle(this));
  this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(40.0D);
  this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(1.0D);
  this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
  this.droppedGemItem=ModItems.PADPARADSCHA_GEM;
  this.droppedCrackedGemItem=ModItems.CRACKED_PADPARADSCHA_GEM;
}

Fixed version (ground truth):
public EntityPadparadscha(World worldIn){
  super(worldIn);
  this.setSize(0.7F,1.6F);
  this.seePastDoors();
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.BACK_OF_HEAD);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.FOREHEAD);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.LEFT_EYE);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.RIGHT_EYE);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.LEFT_CHEEK);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.RIGHT_CHEEK);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.BACK);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.CHEST);
  this.setCutPlacement(GemCuts.FACETED,GemPlacements.BELLY);
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(1,new EntityAIFollowDiamond(this,1.0D));
  this.tasks.addTask(2,new EntityAIRetroVision(this));
  this.tasks.addTask(3,new EntityAIOpenDoor(this,true));
  this.tasks.addTask(4,new EntityAIWander(this,0.6D));
  this.tasks.addTask(5,new EntityAILookIdle(this));
  this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(40.0D);
  this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(1.0D);
  this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
  this.droppedGemItem=ModItems.PADPARADSCHA_GEM;
  this.droppedCrackedGemItem=ModItems.CRACKED_PADPARADSCHA_GEM;
}
Program: 174587
Project: 174587
Buggy source:
@EventHandler public void preInit(FMLPreInitializationEvent event){
  LootSlashConquer.LOGGER.info("String_Node_Str");
  ModLootTables.register();
  ModCapabilities.registerCapabilities();
  ModEntities.registerEntities();
  ModLootFunctions.registerFunctions();
  ModPackets.registerPackets();
  proxy.preInit(event);
}

Fixed version (ground truth):
@EventHandler public void preInit(FMLPreInitializationEvent event){
  LootSlashConquer.LOGGER.info("String_Node_Str");
  ModLootTables.register();
  ModCapabilities.registerCapabilities();
  ModEntities.registerEntities();
  ModLootFunctions.registerFunctions();
  ModPackets.registerPackets();
  ReflectionUtils.setPrivateFinalValue(RangedAttribute.class,(RangedAttribute)SharedMonsterAttributes.MAX_HEALTH,10000000,"String_Node_Str","String_Node_Str");
  ReflectionUtils.setPrivateFinalValue(RangedAttribute.class,(RangedAttribute)SharedMonsterAttributes.ATTACK_DAMAGE,100000,"String_Node_Str","String_Node_Str");
  proxy.preInit(event);
}
Program: 174589
Project: 174589
Buggy source:
@SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event){
  event.getRegistry().register(DUNGEON_BRICK);
  event.getRegistry().register(BOSS_DOOR);
  event.getRegistry().register(COMMON_LOOT_CHEST);
  event.getRegistry().register(UNCOMMON_LOOT_CHEST);
  event.getRegistry().register(RARE_LOOT_CHEST);
  event.getRegistry().register(EPIC_LOOT_CHEST);
  event.getRegistry().register(LEGENDARY_LOOT_CHEST);
  event.getRegistry().register(COMMON_JAR);
  event.getRegistry().register(UNCOMMON_JAR);
  event.getRegistry().register(RARE_JAR);
  event.getRegistry().register(EPIC_JAR);
  event.getRegistry().register(LEGENDARY_JAR);
  event.getRegistry().register(COMMON_BARREL);
  event.getRegistry().register(UNCOMMON_BARREL);
  event.getRegistry().register(RARE_BARREL);
  event.getRegistry().register(EPIC_BARREL);
  event.getRegistry().register(LEGENDARY_BARREL);
  event.getRegistry().register(COMMON_CRATE);
  event.getRegistry().register(UNCOMMON_CRATE);
  event.getRegistry().register(RARE_CRATE);
  event.getRegistry().register(EPIC_CRATE);
  event.getRegistry().register(LEGENDARY_CRATE);
  GameRegistry.registerTileEntity(TileEntityLootChest.class,new ResourceLocation(Reference.MODID,"String_Node_Str"));
}

Fixed version (ground truth):
@SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event){
  event.getRegistry().register(DUNGEON_BRICK);
  event.getRegistry().register(BOSS_DOOR);
  if ((boolean)Launch.blackboard.get("String_Node_Str")) {
    event.getRegistry().register(COMMON_LOOT_CHEST);
    event.getRegistry().register(UNCOMMON_LOOT_CHEST);
    event.getRegistry().register(RARE_LOOT_CHEST);
    event.getRegistry().register(EPIC_LOOT_CHEST);
    event.getRegistry().register(LEGENDARY_LOOT_CHEST);
    event.getRegistry().register(COMMON_JAR);
    event.getRegistry().register(UNCOMMON_JAR);
    event.getRegistry().register(RARE_JAR);
    event.getRegistry().register(EPIC_JAR);
    event.getRegistry().register(LEGENDARY_JAR);
    event.getRegistry().register(COMMON_BARREL);
    event.getRegistry().register(UNCOMMON_BARREL);
    event.getRegistry().register(RARE_BARREL);
    event.getRegistry().register(EPIC_BARREL);
    event.getRegistry().register(LEGENDARY_BARREL);
    event.getRegistry().register(COMMON_CRATE);
    event.getRegistry().register(UNCOMMON_CRATE);
    event.getRegistry().register(RARE_CRATE);
    event.getRegistry().register(EPIC_CRATE);
    event.getRegistry().register(LEGENDARY_CRATE);
  }
  GameRegistry.registerTileEntity(TileEntityLootChest.class,new ResourceLocation(Reference.MODID,"String_Node_Str"));
}
Program: 174591
Project: 174591
Buggy source:
public static double getRangedPower(PlayerInformation playerInfo){
  double multiplier=(Math.random() * (Configs.weaponCategory.damageMaxRandFactor - Configs.weaponCategory.damageMinRandFactor) + Configs.weaponCategory.damageMinRandFactor);
  return (Math.pow(Configs.weaponCategory.damageBaseFactor,playerInfo.getPlayerLevel()) + playerInfo.getBonusDexterityStat()) * (0.85 * multiplier);
}

Fixed version (ground truth):
/** 
 * Returns the player's raw ranged power. This will take the player's Dexterity stat and run it through an algorithm to determine bonus damage. The result is already scaled by the player's Level.
 * @param playerInfo
 * @return
 */
public static double getRangedPower(PlayerInformation playerInfo){
  double multiplier=(Math.random() * (Configs.weaponCategory.damageMaxRandFactor - Configs.weaponCategory.damageMinRandFactor) + Configs.weaponCategory.damageMinRandFactor);
  return (Math.pow(Configs.weaponCategory.damageBaseFactor,playerInfo.getPlayerLevel()) + playerInfo.getBonusDexterityStat()) * (0.85 * multiplier);
}
Program: 174592
Project: 174592
Buggy source:
public static double getMagicalPower(PlayerInformation playerInfo){
  double multiplier=(Math.random() * (Configs.weaponCategory.damageMaxRandFactor - Configs.weaponCategory.damageMinRandFactor) + Configs.weaponCategory.damageMinRandFactor);
  return (Math.pow(Configs.weaponCategory.damageBaseFactor,playerInfo.getPlayerLevel()) + playerInfo.getTotalIntelligence()) * (0.85 * multiplier);
}

Fixed version (ground truth):
/** 
 * Returns the player's raw magical power. This will take the player's Intelligence stat and run it through an algorithm to determine bonus damage. The result is already scaled by the player's Level.
 * @param playerInfo
 * @return
 */
public static double getMagicalPower(PlayerInformation playerInfo){
  double multiplier=(Math.random() * (Configs.weaponCategory.damageMaxRandFactor - Configs.weaponCategory.damageMinRandFactor) + Configs.weaponCategory.damageMinRandFactor);
  return (Math.pow(Configs.weaponCategory.damageBaseFactor,playerInfo.getPlayerLevel()) + playerInfo.getTotalIntelligence()) * (0.85 * multiplier);
}
Program: 174593
Project: 174593
Buggy source:
public static double applyArmorReductions(double damage,EntityPlayer player,PlayerInformation playerInfo){
  return damage * (damage / (damage + getTotalArmor(player,playerInfo)));
}

Fixed version (ground truth):
/** 
 * Applies custom armor reductions to the passed in damage value. This uses a custom algorithm separate from Vanilla's, allowing us to fully customize the damage algorithm and force all damage to use this instead of Vanilla's.
 * @param damage
 * @param player
 * @param playerInfo
 * @return
 */
public static double applyArmorReductions(double damage,EntityPlayer player,PlayerInformation playerInfo){
  return damage * (damage / (damage + getTotalArmor(player,playerInfo)));
}
Program: 174594
Project: 174594
Buggy source:
public static double applyElementalResistance(double damage,LSCDamageSource source,EntityPlayer player){
  double reducedDamage=damage;
  for (  ItemStack stack : player.getArmorInventoryList()) {
    if (stack.getItem() instanceof ItemArmor) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      if (source.isFireDamage() && Attribute.FIRE_RESIST.hasAttribute(nbt))       reducedDamage*=Attribute.FIRE_RESIST.getAmount(nbt);
 else       if (source.isFrostDamage() && Attribute.FROST_RESIST.hasAttribute(nbt))       reducedDamage*=Attribute.FROST_RESIST.getAmount(nbt);
 else       if (source.isLightningDamage() && Attribute.LIGHTNING_RESIST.hasAttribute(nbt))       reducedDamage*=Attribute.LIGHTNING_RESIST.getAmount(nbt);
    }
  }
  return reducedDamage;
}

Fixed version (ground truth):
/** 
 * Applies elemental resistances to the damage passed in. Note, this method only handles elemental resistances for the Player's Armor.
 * @param damage
 * @param source
 * @param player
 * @return
 */
public static double applyElementalResistance(double damage,LSCDamageSource source,EntityPlayer player){
  double reducedDamage=damage;
  for (  ItemStack stack : player.getArmorInventoryList()) {
    if (stack.getItem() instanceof ItemArmor) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      if (source.isFireDamage() && Attribute.FIRE_RESIST.hasAttribute(nbt))       reducedDamage*=Attribute.FIRE_RESIST.getAmount(nbt);
 else       if (source.isFrostDamage() && Attribute.FROST_RESIST.hasAttribute(nbt))       reducedDamage*=Attribute.FROST_RESIST.getAmount(nbt);
 else       if (source.isLightningDamage() && Attribute.LIGHTNING_RESIST.hasAttribute(nbt))       reducedDamage*=Attribute.LIGHTNING_RESIST.getAmount(nbt);
    }
  }
  return reducedDamage;
}
Program: 174595
Project: 174595
Buggy source:
public static double getMeleePower(PlayerInformation playerInfo){
  double multiplier=(Math.random() * (Configs.weaponCategory.damageMaxRandFactor - Configs.weaponCategory.damageMinRandFactor) + Configs.weaponCategory.damageMinRandFactor);
  return (Math.pow(Configs.weaponCategory.damageBaseFactor,playerInfo.getPlayerLevel()) + playerInfo.getTotalStrength()) * (0.85 * multiplier);
}

Fixed version (ground truth):
/** 
 * Returns the player's raw melee power. This will take the player's Strength stat and run it through an algorithm to determine bonus damage. The result is already scaled by the player's Level.
 * @param playerInfo
 * @return
 */
public static double getMeleePower(PlayerInformation playerInfo){
  double multiplier=(Math.random() * (Configs.weaponCategory.damageMaxRandFactor - Configs.weaponCategory.damageMinRandFactor) + Configs.weaponCategory.damageMinRandFactor);
  return (Math.pow(Configs.weaponCategory.damageBaseFactor,playerInfo.getPlayerLevel()) + playerInfo.getTotalStrength()) * (0.85 * multiplier);
}
Program: 174596
Project: 174596
Buggy source:
public static double getTotalArmor(EntityPlayer player,PlayerInformation playerInfo){
  double totalArmorPoints=0;
  for (  ItemStack stack : player.getArmorInventoryList()) {
    if (stack.getItem() instanceof ItemArmor) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      totalArmorPoints+=nbt.getDouble("String_Node_Str");
    }
  }
  return totalArmorPoints;
}

Fixed version (ground truth):
/** 
 * Returns the total number of Armor Points on all the equipped pieces of armor the player currently has.
 * @param player
 * @param playerInfo
 * @return
 */
public static double getTotalArmor(EntityPlayer player,PlayerInformation playerInfo){
  double totalArmorPoints=0;
  for (  ItemStack stack : player.getArmorInventoryList()) {
    if (stack.getItem() instanceof ItemArmor) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      totalArmorPoints+=nbt.getDouble("String_Node_Str");
    }
  }
  return totalArmorPoints;
}
Program: 174598
Project: 174598
Buggy source:
@Override protected void actionPerformed(GuiButton button) throws IOException {
  EntityPlayer player=mc.player;
  PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  if (player != null && playerInfo != null) {
    if (button == warrior) {
      playerInfo.setPlayerClass(1);
      LootSlashConquer.network.sendToServer(new PacketClassSelection(1));
    }
 else     if (button == mage) {
      playerInfo.setPlayerClass(2);
      LootSlashConquer.network.sendToServer(new PacketClassSelection(2));
    }
 else     if (button == hunter) {
      playerInfo.setPlayerClass(3);
      LootSlashConquer.network.sendToServer(new PacketClassSelection(3));
    }
    playerInfo.setPlayerLevel(1);
    this.mc.player.closeScreen();
  }
}

Fixed version (ground truth):
@Override protected void actionPerformed(GuiButton button) throws IOException {
  EntityPlayer player=mc.player;
  PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  if (player != null && playerInfo != null) {
    if (button == warrior) {
      playerInfo.setPlayerClass(1);
      LootSlashConquer.network.sendToServer(new PacketClassSelection(1));
    }
 else     if (button == mage) {
      playerInfo.setPlayerClass(2);
      LootSlashConquer.network.sendToServer(new PacketClassSelection(2));
    }
 else     if (button == hunter) {
      playerInfo.setPlayerClass(3);
      LootSlashConquer.network.sendToServer(new PacketClassSelection(3));
    }
    this.mc.player.closeScreen();
  }
}
Program: 174599
Project: 174599
Buggy source:
@SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event){
  PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
  if (playerInfo != null && playerInfo.getPlayerClass() == 0 && statsCap != null && statsCap.getMaxMana() == 0) {
    LootSlashConquer.network.sendTo(new PacketClassGui(),(EntityPlayerMP)event.player);
    statsCap.setMaxMana(Configs.playerCategory.maxMana);
    statsCap.setMana(statsCap.getMaxMana());
    statsCap.setManaPerSecond(Configs.playerCategory.manaPer5);
    statsCap.setHealthPerSecond(Configs.playerCategory.healthPer5);
    statsCap.setMagicalPower(0);
    statsCap.setCriticalChance(0);
    statsCap.setCriticalDamage(0);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
  }
 else   if (playerInfo != null && statsCap != null && playerInfo.getPlayerClass() > 0) {
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
    LootSlashConquer.network.sendTo(new PacketUpdatePlayerInformation(playerInfo),(EntityPlayerMP)event.player);
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event){
  PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
  if (playerInfo != null && playerInfo.getPlayerClass() == 0 && statsCap != null && statsCap.getMaxMana() == 0) {
    LootSlashConquer.network.sendTo(new PacketClassGui(),(EntityPlayerMP)event.player);
    playerInfo.setPlayerLevel(1);
    statsCap.setMaxMana(Configs.playerCategory.maxMana);
    statsCap.setMana(statsCap.getMaxMana());
    statsCap.setManaPerSecond(Configs.playerCategory.manaPer5);
    statsCap.setHealthPerSecond(Configs.playerCategory.healthPer5);
    statsCap.setMagicalPower(0);
    statsCap.setCriticalChance(0);
    statsCap.setCriticalDamage(0);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
  }
 else   if (playerInfo != null && statsCap != null && playerInfo.getPlayerClass() > 0) {
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
    LootSlashConquer.network.sendTo(new PacketUpdatePlayerInformation(playerInfo),(EntityPlayerMP)event.player);
  }
}
Program: 174600
Project: 174600
Buggy source:
/** 
 * Decreases the current mana count by the given amount. 
 */
public void decreaseMana(int mana){
  this.mana-=mana;
  if (this.mana < 0)   this.mana=0;
}

Fixed version (ground truth):
/** 
 * Decreases the current mana count by the given amount. 
 */
public void decreaseMana(int mana){
  this.setMana(this.getMana() - mana);
  if (this.mana < 0)   this.mana=0;
}
Program: 174601
Project: 174601
Buggy source:
/** 
 * Increases the current mana count by the given amount. 
 */
public void increaseMana(int mana){
  this.mana+=mana;
  if (this.mana > this.maxMana)   this.mana=this.maxMana;
}

Fixed version (ground truth):
/** 
 * Increases the current mana count by the given amount. 
 */
public void increaseMana(int mana){
  this.setMana(this.getMana() + mana);
  if (this.mana > this.maxMana)   this.mana=this.maxMana;
}
Program: 174602
Project: 174602
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);
    }
    this.setDead();
  }
}

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 != player) {
      result.entityHit.setFire(seconds);
    }
    this.setDead();
  }
}
Program: 174603
Project: 174603
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));
    }
    this.setDead();
  }
}

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 != player) {
      ((EntityLivingBase)result.entityHit).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS,20 * seconds,1));
    }
    this.setDead();
  }
}
Program: 174604
Project: 174604
Buggy source:
@Override public void onImpact(RayTraceResult result){
  super.onImpact(result);
  if (!this.getEntityWorld().isRemote) {
    if (result.entityHit != null && result.entityHit instanceof EntityPlayer) {
      Stats statsCap=(Stats)result.entityHit.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        statsCap.decreaseMana(amount);
      }
    }
    this.setDead();
  }
}

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 && result.entityHit != player) {
      Stats statsCap=(Stats)result.entityHit.getCapability(CapabilityPlayerStats.STATS,null);
      if (statsCap != null) {
        statsCap.decreaseMana(amount);
      }
    }
    this.setDead();
  }
}
Program: 174605
Project: 174605
Buggy source:
@Override public void onImpact(RayTraceResult result){
  if (!this.getEntityWorld().isRemote && player != null) {
    Stats stats=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
    PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
    if (result.entityHit != null && result.entityHit instanceof EntityLivingBase && stats != null && playerInfo != 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"));
      damage=DamageUtils.applyDamageModifiers(playerInfo,damage,DamageType.MAGICAL);
      damage=DamageUtils.applyCriticalModifier(stats,damage,nbt);
      result.entityHit.attackEntityFrom(DamageSource.causePlayerDamage(player),(float)damage);
      result.entityHit.hurtResistantTime=0;
      WeaponUtils.useWeaponAttributes((float)damage,player,(EntityLivingBase)result.entityHit,stack,NBTHelper.loadStackNBT(stack));
    }
  }
}

Fixed version (ground truth):
@Override public void onImpact(RayTraceResult result){
  if (!this.getEntityWorld().isRemote && player != null) {
    Stats stats=(Stats)player.getCapability(CapabilityPlayerStats.STATS,null);
    PlayerInformation playerInfo=(PlayerInformation)player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
    if (result.entityHit != null && result.entityHit instanceof EntityLivingBase && result.entityHit != player && stats != null && playerInfo != 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"));
      damage=DamageUtils.applyDamageModifiers(playerInfo,damage,DamageType.MAGICAL);
      damage=DamageUtils.applyCriticalModifier(stats,damage,nbt);
      result.entityHit.attackEntityFrom(DamageSource.causePlayerDamage(player),(float)damage);
      result.entityHit.hurtResistantTime=0;
      WeaponUtils.useWeaponAttributes((float)damage,player,(EntityLivingBase)result.entityHit,stack,NBTHelper.loadStackNBT(stack));
    }
  }
}
Program: 174606
Project: 174606
Buggy source:
@SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event){
  PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
  if (playerInfo != null && playerInfo.getPlayerClass() == 0 && statsCap != null && statsCap.getMaxMana() == 0) {
    LootSlashConquer.network.sendTo(new PacketClassGui(),(EntityPlayerMP)event.player);
    statsCap.setMaxMana(100);
    statsCap.setMana(statsCap.getMaxMana());
    statsCap.setManaPerSecond(10);
    statsCap.setHealthPerSecond(1);
    statsCap.setMagicalPower(0);
    statsCap.setCriticalChance(0);
    statsCap.setCriticalDamage(0);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
  }
 else   if (playerInfo != null && playerInfo.getPlayerClass() > 0)   LootSlashConquer.network.sendTo(new PacketUpdatePlayerInformation(playerInfo),(EntityPlayerMP)event.player);
}

Fixed version (ground truth):
@SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event){
  PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
  if (playerInfo != null && playerInfo.getPlayerClass() == 0 && statsCap != null && statsCap.getMaxMana() == 0) {
    LootSlashConquer.network.sendTo(new PacketClassGui(),(EntityPlayerMP)event.player);
    statsCap.setMaxMana(100);
    statsCap.setMana(statsCap.getMaxMana());
    statsCap.setManaPerSecond(10);
    statsCap.setHealthPerSecond(1);
    statsCap.setMagicalPower(0);
    statsCap.setCriticalChance(0);
    statsCap.setCriticalDamage(0);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
  }
 else   if (playerInfo != null && playerInfo.getPlayerClass() > 0) {
    LootSlashConquer.LOGGER.info(statsCap);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
    LootSlashConquer.network.sendTo(new PacketUpdatePlayerInformation(playerInfo),(EntityPlayerMP)event.player);
  }
}
Program: 174607
Project: 174607
Buggy source:
@Override public NBTBase writeNBT(Capability<IStats> capability,IStats instance,EnumFacing side){
  NBTTagCompound nbt=new NBTTagCompound();
  nbt.setInteger("String_Node_Str",instance.getMana());
  nbt.setInteger("String_Node_Str",instance.getMaxMana());
  nbt.setInteger("String_Node_Str",instance.getManaPerSecond());
  nbt.setDouble("String_Node_Str",instance.getMagicalPower());
  nbt.setInteger("String_Node_Str",instance.getHealthPerSecond());
  nbt.setDouble("String_Node_Str",instance.getCriticalChance());
  nbt.setDouble("String_Node_Str",instance.getCriticalDamage());
  return nbt;
}

Fixed version (ground truth):
@Override public NBTBase writeNBT(Capability<IStats> capability,IStats instance,EnumFacing side){
  NBTTagCompound nbt=new NBTTagCompound();
  nbt.setInteger("String_Node_Str",instance.getMaxMana());
  nbt.setInteger("String_Node_Str",instance.getMana());
  nbt.setInteger("String_Node_Str",instance.getManaPerSecond());
  nbt.setDouble("String_Node_Str",instance.getMagicalPower());
  nbt.setInteger("String_Node_Str",instance.getHealthPerSecond());
  nbt.setDouble("String_Node_Str",instance.getCriticalChance());
  nbt.setDouble("String_Node_Str",instance.getCriticalDamage());
  return nbt;
}
Program: 174608
Project: 174608
Buggy source:
@SubscribeEvent public static void playerClone(PlayerEvent.Clone event){
  IStats oldStats=getStats(event.getOriginal());
  IStats newStats=getStats(event.getEntityLiving());
  if (newStats != null && oldStats != null) {
    newStats.setMana(oldStats.getMana());
    newStats.setMaxMana(oldStats.getMaxMana());
    newStats.setManaPerSecond(oldStats.getManaPerSecond());
    newStats.setMagicalPower(oldStats.getMagicalPower());
    newStats.setHealthPerSecond(oldStats.getHealthPerSecond());
    newStats.setCriticalChance(oldStats.getCriticalChance());
    newStats.setCriticalDamage(oldStats.getCriticalDamage());
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void playerClone(PlayerEvent.Clone event){
  IStats oldStats=getStats(event.getOriginal());
  IStats newStats=getStats(event.getEntityLiving());
  if (newStats != null && oldStats != null) {
    newStats.setMaxMana(oldStats.getMaxMana());
    newStats.setMana(oldStats.getMana());
    newStats.setManaPerSecond(oldStats.getManaPerSecond());
    newStats.setMagicalPower(oldStats.getMagicalPower());
    newStats.setHealthPerSecond(oldStats.getHealthPerSecond());
    newStats.setCriticalChance(oldStats.getCriticalChance());
    newStats.setCriticalDamage(oldStats.getCriticalDamage());
  }
}
Program: 174609
Project: 174609
Buggy source:
public static void register(){
  CapabilityManager.INSTANCE.register(IStats.class,new Capability.IStorage<IStats>(){
    @Override public NBTBase writeNBT(    Capability<IStats> capability,    IStats instance,    EnumFacing side){
      NBTTagCompound nbt=new NBTTagCompound();
      nbt.setInteger("String_Node_Str",instance.getMana());
      nbt.setInteger("String_Node_Str",instance.getMaxMana());
      nbt.setInteger("String_Node_Str",instance.getManaPerSecond());
      nbt.setDouble("String_Node_Str",instance.getMagicalPower());
      nbt.setInteger("String_Node_Str",instance.getHealthPerSecond());
      nbt.setDouble("String_Node_Str",instance.getCriticalChance());
      nbt.setDouble("String_Node_Str",instance.getCriticalDamage());
      return nbt;
    }
    @Override public void readNBT(    Capability<IStats> capability,    IStats instance,    EnumFacing side,    NBTBase nbt){
      NBTTagCompound compound=(NBTTagCompound)nbt;
      instance.setMana(compound.getInteger("String_Node_Str"));
      instance.setMaxMana(compound.getInteger("String_Node_Str"));
      instance.setManaPerSecond(compound.getInteger("String_Node_Str"));
      instance.setMagicalPower(compound.getDouble("String_Node_Str"));
      instance.setHealthPerSecond(compound.getInteger("String_Node_Str"));
      instance.setCriticalChance(compound.getDouble("String_Node_Str"));
      instance.setCriticalDamage(compound.getDouble("String_Node_Str"));
    }
  }
,() -> new Stats(null));
}

Fixed version (ground truth):
public static void register(){
  CapabilityManager.INSTANCE.register(IStats.class,new Capability.IStorage<IStats>(){
    @Override public NBTBase writeNBT(    Capability<IStats> capability,    IStats instance,    EnumFacing side){
      NBTTagCompound nbt=new NBTTagCompound();
      nbt.setInteger("String_Node_Str",instance.getMaxMana());
      nbt.setInteger("String_Node_Str",instance.getMana());
      nbt.setInteger("String_Node_Str",instance.getManaPerSecond());
      nbt.setDouble("String_Node_Str",instance.getMagicalPower());
      nbt.setInteger("String_Node_Str",instance.getHealthPerSecond());
      nbt.setDouble("String_Node_Str",instance.getCriticalChance());
      nbt.setDouble("String_Node_Str",instance.getCriticalDamage());
      return nbt;
    }
    @Override public void readNBT(    Capability<IStats> capability,    IStats instance,    EnumFacing side,    NBTBase nbt){
      NBTTagCompound compound=(NBTTagCompound)nbt;
      instance.setMaxMana(compound.getInteger("String_Node_Str"));
      instance.setMana(compound.getInteger("String_Node_Str"));
      instance.setManaPerSecond(compound.getInteger("String_Node_Str"));
      instance.setMagicalPower(compound.getDouble("String_Node_Str"));
      instance.setHealthPerSecond(compound.getInteger("String_Node_Str"));
      instance.setCriticalChance(compound.getDouble("String_Node_Str"));
      instance.setCriticalDamage(compound.getDouble("String_Node_Str"));
    }
  }
,() -> new Stats(null));
}
Program: 174610
Project: 174610
Buggy source:
@Override public void readNBT(Capability<IStats> capability,IStats instance,EnumFacing side,NBTBase nbt){
  NBTTagCompound compound=(NBTTagCompound)nbt;
  instance.setMana(compound.getInteger("String_Node_Str"));
  instance.setMaxMana(compound.getInteger("String_Node_Str"));
  instance.setManaPerSecond(compound.getInteger("String_Node_Str"));
  instance.setMagicalPower(compound.getDouble("String_Node_Str"));
  instance.setHealthPerSecond(compound.getInteger("String_Node_Str"));
  instance.setCriticalChance(compound.getDouble("String_Node_Str"));
  instance.setCriticalDamage(compound.getDouble("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void readNBT(Capability<IStats> capability,IStats instance,EnumFacing side,NBTBase nbt){
  NBTTagCompound compound=(NBTTagCompound)nbt;
  instance.setMaxMana(compound.getInteger("String_Node_Str"));
  instance.setMana(compound.getInteger("String_Node_Str"));
  instance.setManaPerSecond(compound.getInteger("String_Node_Str"));
  instance.setMagicalPower(compound.getDouble("String_Node_Str"));
  instance.setHealthPerSecond(compound.getInteger("String_Node_Str"));
  instance.setCriticalChance(compound.getDouble("String_Node_Str"));
  instance.setCriticalDamage(compound.getDouble("String_Node_Str"));
}
Program: 174611
Project: 174611
Buggy source:
@SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event){
  PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
  if (playerInfo != null && playerInfo.getPlayerClass() == 0 && statsCap != null && statsCap.getMaxMana() == 0) {
    LootSlashConquer.network.sendTo(new PacketClassGui(),(EntityPlayerMP)event.player);
    statsCap.setMaxMana(100);
    statsCap.setMana(statsCap.getMaxMana());
    statsCap.setManaPerSecond(10);
    statsCap.setHealthPerSecond(1);
    statsCap.setMagicalPower(0);
    statsCap.setCriticalChance(0);
    statsCap.setCriticalDamage(0);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
  }
 else   if (playerInfo != null && playerInfo.getPlayerClass() > 0) {
    LootSlashConquer.LOGGER.info(statsCap);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
    LootSlashConquer.network.sendTo(new PacketUpdatePlayerInformation(playerInfo),(EntityPlayerMP)event.player);
  }
}

Fixed version (ground truth):
@SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event){
  PlayerInformation playerInfo=(PlayerInformation)event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION,null);
  Stats statsCap=(Stats)event.player.getCapability(CapabilityPlayerStats.STATS,null);
  if (playerInfo != null && playerInfo.getPlayerClass() == 0 && statsCap != null && statsCap.getMaxMana() == 0) {
    LootSlashConquer.network.sendTo(new PacketClassGui(),(EntityPlayerMP)event.player);
    statsCap.setMaxMana(100);
    statsCap.setMana(statsCap.getMaxMana());
    statsCap.setManaPerSecond(10);
    statsCap.setHealthPerSecond(1);
    statsCap.setMagicalPower(0);
    statsCap.setCriticalChance(0);
    statsCap.setCriticalDamage(0);
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
  }
 else   if (playerInfo != null && statsCap != null && playerInfo.getPlayerClass() > 0) {
    LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap),(EntityPlayerMP)event.player);
    LootSlashConquer.network.sendTo(new PacketUpdatePlayerInformation(playerInfo),(EntityPlayerMP)event.player);
  }
}
Program: 174612
Project: 174612
Buggy source:
public PacketUpdateStats(Stats statsCap){
  this.mana=statsCap.getMana();
  this.maxMana=statsCap.getMaxMana();
  this.manaPerSecond=statsCap.getManaPerSecond();
  this.magicalPower=statsCap.getMagicalPower();
  this.healthPerSecond=statsCap.getHealthPerSecond();
  this.criticalChance=statsCap.getCriticalChance();
  this.criticalDamage=statsCap.getCriticalDamage();
}

Fixed version (ground truth):
public PacketUpdateStats(Stats statsCap){
  this.maxMana=statsCap.getMaxMana();
  this.mana=statsCap.getMana();
  this.manaPerSecond=statsCap.getManaPerSecond();
  this.magicalPower=statsCap.getMagicalPower();
  this.healthPerSecond=statsCap.getHealthPerSecond();
  this.criticalChance=statsCap.getCriticalChance();
  this.criticalDamage=statsCap.getCriticalDamage();
}
Program: 174613
Project: 174613
Buggy source:
@Override public void toBytes(ByteBuf buf){
  buf.writeInt(mana);
  buf.writeInt(maxMana);
  buf.writeInt(manaPerSecond);
  buf.writeDouble(magicalPower);
  buf.writeInt(healthPerSecond);
  buf.writeDouble(criticalChance);
  buf.writeDouble(criticalDamage);
}

Fixed version (ground truth):
@Override public void toBytes(ByteBuf buf){
  buf.writeInt(maxMana);
  buf.writeInt(mana);
  buf.writeInt(manaPerSecond);
  buf.writeDouble(magicalPower);
  buf.writeInt(healthPerSecond);
  buf.writeDouble(criticalChance);
  buf.writeDouble(criticalDamage);
}
Program: 174614
Project: 174614
Buggy source:
@Override public void fromBytes(ByteBuf buf){
  mana=buf.readInt();
  maxMana=buf.readInt();
  manaPerSecond=buf.readInt();
  magicalPower=buf.readDouble();
  healthPerSecond=buf.readInt();
  criticalChance=buf.readDouble();
  criticalDamage=buf.readDouble();
}

Fixed version (ground truth):
@Override public void fromBytes(ByteBuf buf){
  maxMana=buf.readInt();
  mana=buf.readInt();
  manaPerSecond=buf.readInt();
  magicalPower=buf.readDouble();
  healthPerSecond=buf.readInt();
  criticalChance=buf.readDouble();
  criticalDamage=buf.readDouble();
}