nus-yam/ex-repair huggingface dataset:
Program: 8237
Project: 8237
Buggy source:
public static ItemStack getFirstBagWithSuctionItem(EntityPlayer player,NonNullList<ItemStack> inventory){
  for (  ItemStack stack : inventory) {
    if (stack.isEmpty()) {
      continue;
    }
    if (stack.getItem() == ObjHandler.alchBag) {
      IItemHandler inv=player.getCapability(ProjectEAPI.ALCH_BAG_CAPABILITY,null).getBag(EnumDyeColor.byMetadata(stack.getItemDamage()));
      if (ItemHelper.invContainsItem(inv,new ItemStack(ObjHandler.blackHole,1,1)) || ItemHelper.invContainsItem(inv,new ItemStack(ObjHandler.voidRing,1,1)))       return stack;
    }
  }
  return ItemStack.EMPTY;
}

Fixed version (ground truth):
public static ItemStack getFirstBagWithSuctionItem(EntityPlayer player,NonNullList<ItemStack> inventory){
  for (  ItemStack stack : inventory) {
    if (stack.isEmpty()) {
      continue;
    }
    if (stack.getItem() == ObjHandler.alchBag) {
      IItemHandler inv=player.getCapability(ProjectEAPI.ALCH_BAG_CAPABILITY,null).getBag(EnumDyeColor.byMetadata(stack.getItemDamage()));
      for (int i=0; i < inv.getSlots(); i++) {
        ItemStack ring=inv.getStackInSlot(i);
        if (!ring.isEmpty() && (ring.getItem() instanceof BlackHoleBand || ring.getItem() instanceof VoidRing)) {
          if (ItemHelper.getOrCreateCompound(ring).getBoolean(TAG_ACTIVE)) {
            return stack;
          }
        }
      }
    }
  }
  return ItemStack.EMPTY;
}
Program: 8238
Project: 8238
Buggy source:
@Override public void onUpdate(ItemStack stack,World world,Entity entity,int slot,boolean isHeld){
  super.onUpdate(stack,world,entity,slot,isHeld);
  ObjHandler.blackHole.onUpdate(stack,world,entity,slot,isHeld);
  if (!ItemHelper.getOrCreateCompound(stack).hasKey("String_Node_Str")) {
    stack.getTagCompound().setByte("String_Node_Str",((byte)10));
  }
  stack.getTagCompound().setByte("String_Node_Str",((byte)(stack.getTagCompound().getByte("String_Node_Str") - 1)));
}

Fixed version (ground truth):
@Override public void onUpdate(ItemStack stack,World world,Entity entity,int slot,boolean isHeld){
  super.onUpdate(stack,world,entity,slot,isHeld);
  ObjHandler.blackHole.onUpdate(stack,world,entity,slot,isHeld);
  if (!ItemHelper.getOrCreateCompound(stack).hasKey("String_Node_Str")) {
    stack.getTagCompound().setByte("String_Node_Str",((byte)10));
  }
  if (stack.getTagCompound().getByte("String_Node_Str") > 0) {
    stack.getTagCompound().setByte("String_Node_Str",((byte)(stack.getTagCompound().getByte("String_Node_Str") - 1)));
  }
}
Program: 8239
Project: 8239
Buggy source:
@Override public void sync(@Nonnull EnumDyeColor color,@Nonnull EntityPlayerMP player){
  PacketHandler.sendTo(new SyncBagDataPKT(writeNBT(color)),player);
}

Fixed version (ground truth):
@Override public void sync(@Nullable EnumDyeColor color,@Nonnull EntityPlayerMP player){
  PacketHandler.sendTo(new SyncBagDataPKT(writeNBT(color)),player);
}
Program: 8240
Project: 8240
Buggy source:
/** 
 * Does not consider stack size
 */
public static int getEmcValue(ItemStack stack){
  if (stack == null) {
    return 0;
  }
  SimpleStack iStack=new SimpleStack(stack);
  if (!iStack.isValid()) {
    return 0;
  }
  if (!EMCMapper.mapContains(iStack) && ItemHelper.isDamageable(stack)) {
    iStack=iStack.withMeta(0);
    if (EMCMapper.mapContains(iStack)) {
      int emc=EMCMapper.getEmcValue(iStack);
      int relDamage=(stack.getMaxDamage() - stack.getItemDamage());
      if (relDamage <= 0) {
        return emc;
      }
      long result=emc * relDamage;
      if (result <= 0) {
        return emc;
      }
      result/=stack.getMaxDamage();
      result+=getEnchantEmcBonus(stack);
      result+=getStoredEMCBonus(stack);
      if (result > Integer.MAX_VALUE) {
        return emc;
      }
      if (result <= 0) {
        return 1;
      }
      return (int)result;
    }
  }
 else {
    if (EMCMapper.mapContains(iStack)) {
      return EMCMapper.getEmcValue(iStack) + getEnchantEmcBonus(stack) + (int)getStoredEMCBonus(stack);
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Does not consider stack size
 */
public static int getEmcValue(ItemStack stack){
  if (stack == null) {
    return 0;
  }
  SimpleStack iStack=new SimpleStack(stack);
  if (!iStack.isValid()) {
    return 0;
  }
  if (!EMCMapper.mapContains(iStack) && ItemHelper.isDamageable(stack)) {
    iStack=iStack.withMeta(0);
    if (EMCMapper.mapContains(iStack)) {
      int emc=EMCMapper.getEmcValue(iStack);
      int relDamage=(stack.getMaxDamage() + 1 - stack.getItemDamage());
      if (relDamage <= 0) {
        return emc;
      }
      long result=emc * relDamage;
      if (result <= 0) {
        return emc;
      }
      result/=stack.getMaxDamage();
      result+=getEnchantEmcBonus(stack);
      result+=getStoredEMCBonus(stack);
      if (result > Integer.MAX_VALUE) {
        return emc;
      }
      if (result <= 0) {
        return 1;
      }
      return (int)result;
    }
  }
 else {
    if (EMCMapper.mapContains(iStack)) {
      return EMCMapper.getEmcValue(iStack) + getEnchantEmcBonus(stack) + (int)getStoredEMCBonus(stack);
    }
  }
  return 0;
}
Program: 8241
Project: 8241
Buggy source:
@Override public ItemStack transferStackInSlot(EntityPlayer player,int slotIndex){
  Slot slot=this.getSlot(slotIndex);
  if (slot == null || !slot.getHasStack()) {
    return null;
  }
  ItemStack stack=slot.getStack();
  ItemStack newStack=stack.copy();
  if (slotIndex <= 7) {
    return null;
  }
 else   if (slotIndex >= 10 && slotIndex <= 25) {
    int emc=EMCHelper.getEmcValue(newStack);
    int stackSize=0;
    IItemHandler inv=player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,EnumFacing.UP);
    while (transmutationInventory.provider.getEmc() >= emc && stackSize < newStack.getMaxStackSize() && ItemHelper.hasSpace(player.inventory.mainInventory,newStack)) {
      transmutationInventory.removeEmc(emc);
      ItemHandlerHelper.insertItemStacked(inv,ItemHelper.getNormalizedStack(stack),false);
      stackSize++;
    }
    transmutationInventory.updateClientTargets();
  }
 else   if (slotIndex >= 26) {
    int emc=EMCHelper.getEmcValue(stack);
    if (emc == 0 && stack.getItem() != ObjHandler.tome) {
      return null;
    }
    while (!transmutationInventory.hasMaxedEmc() && stack.stackSize > 0) {
      transmutationInventory.addEmc(emc);
      --stack.stackSize;
    }
    transmutationInventory.handleKnowledge(newStack);
    if (stack.stackSize == 0) {
      slot.putStack(null);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public ItemStack transferStackInSlot(EntityPlayer player,int slotIndex){
  Slot slot=this.getSlot(slotIndex);
  if (slot == null || !slot.getHasStack()) {
    return null;
  }
  ItemStack stack=slot.getStack();
  ItemStack newStack=stack.copy();
  if (slotIndex <= 7) {
    return null;
  }
 else   if (slotIndex >= 11 && slotIndex <= 26) {
    int emc=EMCHelper.getEmcValue(newStack);
    int stackSize=0;
    IItemHandler inv=player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,EnumFacing.UP);
    while (transmutationInventory.provider.getEmc() >= emc && stackSize < newStack.getMaxStackSize() && ItemHelper.hasSpace(player.inventory.mainInventory,newStack)) {
      transmutationInventory.removeEmc(emc);
      ItemHandlerHelper.insertItemStacked(inv,ItemHelper.getNormalizedStack(stack),false);
      stackSize++;
    }
    transmutationInventory.updateClientTargets();
  }
 else   if (slotIndex > 26) {
    int emc=EMCHelper.getEmcValue(stack);
    if (emc == 0 && stack.getItem() != ObjHandler.tome) {
      return null;
    }
    while (!transmutationInventory.hasMaxedEmc() && stack.stackSize > 0) {
      transmutationInventory.addEmc(emc);
      --stack.stackSize;
    }
    transmutationInventory.handleKnowledge(newStack);
    if (stack.stackSize == 0) {
      slot.putStack(null);
    }
  }
  return null;
}
Program: 8242
Project: 8242
Buggy source:
public CondenserContainer(InventoryPlayer invPlayer,CondenserTile condenser){
  tile=condenser;
  tile.numPlayersUsing++;
  this.addSlotToContainer(new SlotCondenserLock(this,0,12,6));
  IItemHandler handler=tile.getInput();
  int counter=0;
  for (int i=0; i < 7; i++)   for (int j=0; j < 13; j++)   this.addSlotToContainer(new ValidatedSlot(handler,counter++,12 + j * 18,26 + i * 18,SlotPredicates.HAS_EMC));
  for (int i=0; i < 3; i++)   for (int j=0; j < 9; j++)   this.addSlotToContainer(new Slot(invPlayer,j + i * 9 + 9,48 + j * 18,154 + i * 18));
  for (int i=0; i < 9; i++)   this.addSlotToContainer(new Slot(invPlayer,i,48 + i * 18,212));
}

Fixed version (ground truth):
public CondenserContainer(InventoryPlayer invPlayer,CondenserTile condenser){
  tile=condenser;
  tile.numPlayersUsing++;
  this.addSlotToContainer(new SlotCondenserLock(this,0,12,6));
  IItemHandler handler=tile.getInput();
  int counter=0;
  for (int i=0; i < 7; i++)   for (int j=0; j < 13; j++)   this.addSlotToContainer(new SlotItemHandler(handler,counter++,12 + j * 18,26 + i * 18));
  for (int i=0; i < 3; i++)   for (int j=0; j < 9; j++)   this.addSlotToContainer(new Slot(invPlayer,j + i * 9 + 9,48 + j * 18,154 + i * 18));
  for (int i=0; i < 9; i++)   this.addSlotToContainer(new Slot(invPlayer,i,48 + i * 18,212));
}
Program: 8243
Project: 8243
Buggy source:
protected ItemStackHandler createInput(){
  return new StackHandler(91);
}

Fixed version (ground truth):
protected ItemStackHandler createInput(){
  return new StackHandler(91){
    @Override public ItemStack insertItem(    int slot,    ItemStack stack,    boolean simulate){
      if (!isStackEqualToLock(stack) && EMCHelper.doesItemHaveEmc(stack))       return super.insertItem(slot,stack,simulate);
 else       return stack;
    }
  }
;
}
Program: 8244
Project: 8244
Buggy source:
@Override public ItemStack insertItem(int slot,ItemStack stack,boolean simulate){
  if (TileEntityFurnace.isItemFuel(stack) || stack.getItem() instanceof IItemEmc)   return super.insertItem(slot,stack,simulate);
 else   return null;
}

Fixed version (ground truth):
@Override public ItemStack insertItem(int slot,ItemStack stack,boolean simulate){
  if (TileEntityFurnace.isItemFuel(stack) || stack.getItem() instanceof IItemEmc)   return super.insertItem(slot,stack,simulate);
 else   return stack;
}
Program: 8245
Project: 8245
Buggy source:
@Override public ItemStack extractItem(int slot,int amount,boolean simulate){
  ItemStack stack=getStackInSlot(slot);
  if (stack != null && stack.getItem() instanceof IItemEmc) {
    IItemEmc item=((IItemEmc)stack.getItem());
    if (item.getStoredEmc(stack) >= item.getMaximumEmc(stack)) {
      return super.extractItem(slot,amount,simulate);
    }
  }
  return super.extractItem(slot,amount,simulate);
}

Fixed version (ground truth):
@Override public ItemStack extractItem(int slot,int amount,boolean simulate){
  ItemStack stack=getStackInSlot(slot);
  if (stack != null && stack.getItem() instanceof IItemEmc) {
    IItemEmc item=((IItemEmc)stack.getItem());
    if (item.getStoredEmc(stack) >= item.getMaximumEmc(stack)) {
      return super.extractItem(slot,amount,simulate);
    }
 else {
      return null;
    }
  }
  return super.extractItem(slot,amount,simulate);
}
Program: 8246
Project: 8246
Buggy source:
public int getKleinStarChargeScaled(int i){
  if (inventory[0] == null || displayItemCharge <= 0) {
    return 0;
  }
  return ((int)Math.round(displayItemCharge * i / ((IItemEmc)inventory[0].getItem()).getMaximumEmc(inventory[0])));
}

Fixed version (ground truth):
public int getKleinStarChargeScaled(int i){
  if (inventory[0] == null || displayItemCharge <= 0 || !(inventory[0].getItem() instanceof IItemEmc)) {
    return 0;
  }
  return ((int)Math.round(displayItemCharge * i / ((IItemEmc)inventory[0].getItem()).getMaximumEmc(inventory[0])));
}
Program: 8247
Project: 8247
Buggy source:
@Override public void renderTileEntityAt(DMPedestalTile te,double x,double y,double z,float partialTicks,int destroyStage){
  if (!te.isInvalid()) {
    if (te.getItemStack() != null) {
      GlStateManager.pushMatrix();
      GlStateManager.translate(x + 0.5,y + 1,z + 0.5);
      GlStateManager.scale(0.5,0.5,0.5);
      GlStateManager.translate(0,0.3 * Math.sin(0.1 * (te.getWorld().getWorldTime() + partialTicks)),0);
      float angle=(te.getWorld().getWorldTime() + partialTicks) / 20.0F * (180F / (float)Math.PI);
      GlStateManager.rotate(angle,0.0F,1.0F,0.0F);
      Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
      Minecraft.getMinecraft().getRenderItem().func_181564_a(te.getItemStack(),ItemCameraTransforms.TransformType.GROUND);
      GlStateManager.popMatrix();
    }
  }
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(DMPedestalTile te,double x,double y,double z,float partialTicks,int destroyStage){
  if (!te.isInvalid()) {
    if (te.getItemStack() != null) {
      GlStateManager.pushMatrix();
      GlStateManager.translate(x + 0.5,y + 1,z + 0.5);
      GlStateManager.scale(0.5,0.5,0.5);
      GlStateManager.translate(0,0.3 * Math.sin(0.1 * (te.getWorld().getWorldTime() + partialTicks)),0);
      float angle=(te.getWorld().getWorldTime() + partialTicks) / 20.0F * (180F / (float)Math.PI);
      GlStateManager.rotate(angle,0.0F,1.0F,0.0F);
      Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
      Minecraft.getMinecraft().getRenderItem().renderItem(te.getItemStack(),ItemCameraTransforms.TransformType.GROUND);
      GlStateManager.popMatrix();
    }
  }
}
Program: 8248
Project: 8248
Buggy source:
public static void registerMCBindings(){
  ImmutableBiMap.Builder<KeyBinding,PEKeybind> builder=ImmutableBiMap.builder();
  for (  PEKeybind k : PEKeybind.values()) {
    KeyBinding mcK=new KeyBinding(StatCollector.translateToLocal(k.keyName),k.defaultKeyCode,PECore.MODID);
    builder.put(mcK,k);
    ClientRegistry.registerKeyBinding(mcK);
  }
  mcToPe=builder.build();
  peToMc=mcToPe.inverse();
}

Fixed version (ground truth):
public static void registerMCBindings(){
  ImmutableBiMap.Builder<KeyBinding,PEKeybind> builder=ImmutableBiMap.builder();
  for (  PEKeybind k : PEKeybind.values()) {
    KeyBinding mcK=new KeyBinding(k.keyName,k.defaultKeyCode,PECore.MODID);
    builder.put(mcK,k);
    ClientRegistry.registerKeyBinding(mcK);
  }
  mcToPe=builder.build();
  peToMc=mcToPe.inverse();
}
Program: 8249
Project: 8249
Buggy source:
@Mod.EventHandler public void serverStarting(FMLServerStartingEvent event){
  event.registerServerCommand(new ProjectECMD());
  if (!ThreadCheckUpdate.hasRunServer()) {
    new ThreadCheckUpdate(true).start();
  }
  if (!ThreadCheckUUID.hasRunServer()) {
    new ThreadCheckUUID(true).start();
  }
  long start=System.currentTimeMillis();
  CustomEMCParser.readUserData();
  PELogger.logInfo("String_Node_Str");
  EMCMapper.map();
  PELogger.logInfo("String_Node_Str" + EMCMapper.emc.size() + "String_Node_Str"+ (System.currentTimeMillis() - start)+ "String_Node_Str");
  File dir=new File(event.getServer().getEntityWorld().getSaveHandler().getWorldDirectory(),"String_Node_Str");
  if (!dir.exists()) {
    dir.mkdirs();
  }
  IOHandler.init(new File(dir,"String_Node_Str"),new File(dir,"String_Node_Str"));
}

Fixed version (ground truth):
@Mod.EventHandler public void serverStarting(FMLServerStartingEvent event){
  event.registerServerCommand(new ProjectECMD());
  if (!ThreadCheckUpdate.hasRunServer()) {
    new ThreadCheckUpdate(true).start();
  }
  if (!ThreadCheckUUID.hasRunServer()) {
    new ThreadCheckUUID(true).start();
  }
  long start=System.currentTimeMillis();
  CustomEMCParser.readUserData();
  PELogger.logInfo("String_Node_Str");
  EMCMapper.map();
  PELogger.logInfo("String_Node_Str" + EMCMapper.emc.size() + "String_Node_Str"+ (System.currentTimeMillis() - start)+ "String_Node_Str");
  File dir=new File(event.getServer().getEntityWorld().getSaveHandler().getWorldDirectory(),"String_Node_Str");
  if (!dir.exists()) {
    dir.mkdirs();
  }
}
Program: 8251
Project: 8251
Buggy source:
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int blockX,int blockY,int blockZ,int sideHit,float px,float py,float pz){
  if (world.isRemote) {
    return false;
  }
  MetaBlock mBlock=new MetaBlock(world,blockX,blockY,blockZ);
  if (mBlock.getBlock() != Blocks.air) {
    TileEntity tile=world.getTileEntity(blockX,blockY,blockZ);
    if (player.isSneaking()) {
      if (tile instanceof TileEmc) {
        NBTTagCompound nbt=new NBTTagCompound();
        nbt.setBoolean("String_Node_Str",true);
        tile.writeToNBT(nbt);
        if (mBlock.getBlock() == ObjHandler.dmFurnaceOn) {
          mBlock.setBlock(ObjHandler.dmFurnaceOff);
        }
 else         if (mBlock.getBlock() == ObjHandler.rmFurnaceOn) {
          mBlock.setBlock(ObjHandler.rmFurnaceOff);
        }
        ItemStack s=mBlock.toItemStack();
        if (s.getHasSubtypes()) {
          s.setItemDamage(world.getBlockMetadata(blockX,blockY,blockZ));
        }
 else {
          s.setItemDamage(0);
        }
        s.setTagCompound(nbt);
        world.removeTileEntity(blockX,blockY,blockZ);
        world.setBlock(blockX,blockY,blockZ,Blocks.air,0,2);
        WorldHelper.spawnEntityItem(world,s,blockX,blockY,blockZ);
      }
    }
  }
  MetaBlock result=WorldTransmutations.getWorldTransmutation(world,blockX,blockY,blockZ,player.isSneaking());
  if (result != null) {
    Coordinates pos=new Coordinates(blockX,blockY,blockZ);
    int mode=this.getMode(stack);
    int charge=this.getCharge(stack);
    ForgeDirection direction=ForgeDirection.getOrientation(sideHit);
    if (mode == 0) {
      doWorldTransmutation(world,mBlock,result,pos,0,0,charge,player);
    }
 else     if (mode == 1) {
      getAxisOrientedPanel(direction,charge,mBlock,result,pos,world,player);
    }
 else {
      getAxisOrientedLine(direction,charge,mBlock,result,pos,world,player);
    }
    world.playSoundAtEntity(player,"String_Node_Str",1.0F,1.0F);
    PlayerHelper.swingItem(player);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int blockX,int blockY,int blockZ,int sideHit,float px,float py,float pz){
  if (world.isRemote) {
    return false;
  }
  MetaBlock mBlock=new MetaBlock(world,blockX,blockY,blockZ);
  MetaBlock result=WorldTransmutations.getWorldTransmutation(world,blockX,blockY,blockZ,player.isSneaking());
  if (result != null) {
    Coordinates pos=new Coordinates(blockX,blockY,blockZ);
    int mode=this.getMode(stack);
    int charge=this.getCharge(stack);
    ForgeDirection direction=ForgeDirection.getOrientation(sideHit);
    if (mode == 0) {
      doWorldTransmutation(world,mBlock,result,pos,0,0,charge,player);
    }
 else     if (mode == 1) {
      getAxisOrientedPanel(direction,charge,mBlock,result,pos,world,player);
    }
 else {
      getAxisOrientedLine(direction,charge,mBlock,result,pos,world,player);
    }
    world.playSoundAtEntity(player,"String_Node_Str",1.0F,1.0F);
    PlayerHelper.swingItem(player);
  }
  return true;
}
Program: 8252
Project: 8252
Buggy source:
@Override public ItemStack onItemRightClick(ItemStack stack,World world,EntityPlayer player){
  deforestAOE(world,stack,player,0);
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack onItemRightClick(ItemStack stack,World world,EntityPlayer player){
  clearOdAOE(world,stack,player,"String_Node_Str",0);
  clearOdAOE(world,stack,player,"String_Node_Str",0);
  return stack;
}
Program: 8253
Project: 8253
Buggy source:
@Override public ItemStack onItemRightClick(ItemStack stack,World world,EntityPlayer player){
  player.setItemInUse(stack,this.getMaxItemUseDuration(stack));
  if (world.isRemote) {
    return stack;
  }
  MovingObjectPosition mop=this.getMovingObjectPositionFromPlayer(world,player,false);
  if (mop != null) {
    if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
      Block blockHit=world.getBlock(mop.blockX,mop.blockY,mop.blockZ);
      if (blockHit instanceof BlockGrass || blockHit instanceof BlockDirt) {
        tillAOE(stack,player,world,mop.blockX,mop.blockY,mop.blockZ,world.getBlockMetadata(mop.blockX,mop.blockY,mop.blockZ),0);
      }
 else       if (blockHit instanceof BlockLog) {
        deforestAOE(world,stack,player,0);
      }
    }
  }
 else {
    shearEntityAOE(stack,player,0);
  }
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack onItemRightClick(ItemStack stack,World world,EntityPlayer player){
  player.setItemInUse(stack,this.getMaxItemUseDuration(stack));
  if (world.isRemote) {
    return stack;
  }
  MovingObjectPosition mop=this.getMovingObjectPositionFromPlayer(world,player,false);
  if (mop != null) {
    if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
      Block blockHit=world.getBlock(mop.blockX,mop.blockY,mop.blockZ);
      if (blockHit instanceof BlockGrass || blockHit instanceof BlockDirt) {
        tillAOE(stack,player,world,mop.blockX,mop.blockY,mop.blockZ,world.getBlockMetadata(mop.blockX,mop.blockY,mop.blockZ),0);
      }
 else       if (blockHit instanceof BlockLog) {
        clearOdAOE(world,stack,player,"String_Node_Str",0);
      }
 else       if (blockHit instanceof BlockLeaves) {
        clearOdAOE(world,stack,player,"String_Node_Str",0);
      }
    }
  }
 else {
    shearEntityAOE(stack,player,0);
  }
  return stack;
}
Program: 8254
Project: 8254
Buggy source:
@Override public void doExtraFunction(ItemStack stack,EntityPlayer player){
  attackAOE(stack,player,getMode(stack) == 1,KATAR_DEATHATTACK,0);
}

Fixed version (ground truth):
@Override public void doExtraFunction(ItemStack stack,EntityPlayer player){
  attackAOE(stack,player,getMode(stack) == 1,ProjectEConfig.katarDeathAura,0);
}
Program: 8255
Project: 8255
Buggy source:
public void checkLockAndUpdate(){
  lock=inventory[0];
  if (lock == null) {
    displayEmc=0;
    requiredEmc=0;
    this.isAcceptingEmc=false;
    return;
  }
  if (EMCHelper.doesItemHaveEmc(lock)) {
    int lockEmc=EMCHelper.getEmcValue(lock);
    if (requiredEmc != lockEmc) {
      requiredEmc=lockEmc;
      this.isAcceptingEmc=true;
    }
    if (this.getStoredEmc() > requiredEmc) {
      handleMassCondense();
    }
  }
 else {
    lock=null;
    inventory[0]=null;
    displayEmc=0;
    requiredEmc=0;
    this.isAcceptingEmc=false;
  }
}

Fixed version (ground truth):
public void checkLockAndUpdate(){
  lock=inventory[0];
  if (lock == null) {
    displayEmc=0;
    requiredEmc=0;
    this.isAcceptingEmc=false;
    return;
  }
  if (EMCHelper.doesItemHaveEmc(lock)) {
    int lockEmc=EMCHelper.getEmcValue(lock);
    if (requiredEmc != lockEmc) {
      requiredEmc=lockEmc;
      this.isAcceptingEmc=true;
    }
  }
 else {
    lock=null;
    inventory[0]=null;
    displayEmc=0;
    requiredEmc=0;
    this.isAcceptingEmc=false;
  }
}
Program: 8256
Project: 8256
Buggy source:
public static void onPlayerChangeDimension(EntityPlayerMP playerMP){
  PlayerHelper.updateClientServerFlight(playerMP,playerMP.capabilities.allowFlying);
  PlayerHelper.updateClientServerStepHeight(playerMP,playerMP.stepHeight);
}

Fixed version (ground truth):
public static void onPlayerChangeDimension(EntityPlayerMP playerMP){
  PlayerHelper.updateClientServerFlight(playerMP,playerMP.capabilities.allowFlying);
  PlayerHelper.updateClientServerStepHeight(playerMP,shouldPlayerStep(playerMP) ? 1.0F : 0.5F);
}
Program: 8257
Project: 8257
Buggy source:
public static void update(EntityPlayerMP player){
  if (!shouldPlayerFly(player) && hadFlightItem.contains(player)) {
    if (player.capabilities.allowFlying) {
      PlayerHelper.updateClientServerFlight(player,false);
    }
    hadFlightItem.remove(player);
  }
 else   if (shouldPlayerFly(player) && !hadFlightItem.contains(player)) {
    if (!player.capabilities.allowFlying) {
      PlayerHelper.updateClientServerFlight(player,true);
    }
    hadFlightItem.add(player);
  }
  if (!shouldPlayerResistFire(player)) {
    if (player.isImmuneToFire()) {
      PlayerHelper.setPlayerFireImmunity(player,false);
    }
  }
 else {
    if (!player.isImmuneToFire()) {
      PlayerHelper.setPlayerFireImmunity(player,true);
    }
  }
  if (!shouldPlayerStep(player)) {
    if (player.stepHeight > 0.5F) {
      PlayerHelper.updateClientServerStepHeight(player,0.5F);
    }
  }
 else {
    if (player.stepHeight < 1.0F) {
      PlayerHelper.updateClientServerStepHeight(player,1.0F);
    }
  }
}

Fixed version (ground truth):
public static void update(EntityPlayerMP player){
  if (projectileCooldowns.containsKey(player) && projectileCooldowns.get(player) > 0) {
    projectileCooldowns.adjustValue(player,-1);
  }
  if (!shouldPlayerFly(player) && hadFlightItem.contains(player)) {
    if (player.capabilities.allowFlying) {
      PlayerHelper.updateClientServerFlight(player,false);
    }
    hadFlightItem.remove(player);
  }
 else   if (shouldPlayerFly(player) && !hadFlightItem.contains(player)) {
    if (!player.capabilities.allowFlying) {
      PlayerHelper.updateClientServerFlight(player,true);
    }
    hadFlightItem.add(player);
  }
  if (!shouldPlayerResistFire(player)) {
    if (player.isImmuneToFire()) {
      PlayerHelper.setPlayerFireImmunity(player,false);
    }
  }
 else {
    if (!player.isImmuneToFire()) {
      PlayerHelper.setPlayerFireImmunity(player,true);
    }
  }
  if (!shouldPlayerStep(player)) {
    if (player.stepHeight > 0.5F) {
      PlayerHelper.updateClientServerStepHeight(player,0.5F);
    }
  }
 else {
    if (player.stepHeight < 1.0F) {
      PlayerHelper.updateClientServerStepHeight(player,1.0F);
    }
  }
}
Program: 8258
Project: 8258
Buggy source:
public static void clearLists(){
  swrgOverrides.clear();
  gemArmorReadyChecks.clear();
}

Fixed version (ground truth):
public static void clearLists(){
  swrgOverrides.clear();
  gemArmorReadyChecks.clear();
  hadFlightItem.clear();
  projectileCooldowns.clear();
}
Program: 8259
Project: 8259
Buggy source:
public static void removePlayerFromLists(EntityPlayerMP player){
  swrgOverrides.remove(player);
  gemArmorReadyChecks.remove(player);
}

Fixed version (ground truth):
public static void removePlayerFromLists(EntityPlayerMP player){
  swrgOverrides.remove(player);
  gemArmorReadyChecks.remove(player);
  hadFlightItem.remove(player);
  projectileCooldowns.remove(player);
}
Program: 8261
Project: 8261
Buggy source:
@Override public void saveNBTData(NBTTagCompound compound){
  NBTTagCompound properties=new NBTTagCompound();
  NBTTagList listOfInventories=new NBTTagList();
  for (int i=0; i < 16; i++) {
    if (bagData.get(i) == null) {
      continue;
    }
    NBTTagCompound inventory=new NBTTagCompound();
    inventory.setInteger("String_Node_Str",i);
    inventory.setTag("String_Node_Str",ItemHelper.toIndexedNBTList(bagData.get(i)));
    listOfInventories.appendTag(inventory);
  }
  properties.setTag("String_Node_Str",listOfInventories);
  properties.setBoolean("String_Node_Str",hasMigrated);
  compound.setTag(PROP_NAME,properties);
}

Fixed version (ground truth):
@Override public void saveNBTData(NBTTagCompound compound){
  NBTTagCompound properties=new NBTTagCompound();
  NBTTagList listOfInventories=new NBTTagList();
  for (int i=0; i < 16; i++) {
    if (bagData.get(i) == null) {
      continue;
    }
    NBTTagCompound inventory=new NBTTagCompound();
    inventory.setInteger("String_Node_Str",i);
    inventory.setTag("String_Node_Str",ItemHelper.toIndexedNBTList(bagData.get(i)));
    listOfInventories.appendTag(inventory);
  }
  properties.setTag("String_Node_Str",listOfInventories);
  compound.setTag(PROP_NAME,properties);
}
Program: 8262
Project: 8262
Buggy source:
@Override public void loadNBTData(NBTTagCompound compound){
  NBTTagCompound properties=compound.getCompoundTag(PROP_NAME);
  NBTTagList listOfInventoies=properties.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
  hasMigrated=properties.getBoolean("String_Node_Str");
  if (!hasMigrated && !player.worldObj.isRemote) {
    if (AlchemicalBags.hasLegacyData(player)) {
      listOfInventoies=AlchemicalBags.migratePlayerData(player);
      PELogger.logInfo("String_Node_Str" + player.getCommandSenderName() + "String_Node_Str");
    }
 else {
      PELogger.logInfo("String_Node_Str" + player.getCommandSenderName() + "String_Node_Str");
    }
    hasMigrated=true;
  }
  for (int i=0; i < listOfInventoies.tagCount(); i++) {
    NBTTagCompound inventory=listOfInventoies.getCompoundTagAt(i);
    bagData.put(inventory.getInteger("String_Node_Str"),ItemHelper.copyIndexedNBTToArray(inventory.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND),new ItemStack[104]));
  }
}

Fixed version (ground truth):
@Override public void loadNBTData(NBTTagCompound compound){
  NBTTagCompound properties=compound.getCompoundTag(PROP_NAME);
  NBTTagList listOfInventoies=properties.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
  for (int i=0; i < listOfInventoies.tagCount(); i++) {
    NBTTagCompound inventory=listOfInventoies.getCompoundTagAt(i);
    bagData.put(inventory.getInteger("String_Node_Str"),ItemHelper.copyIndexedNBTToArray(inventory.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND),new ItemStack[104]));
  }
}
Program: 8263
Project: 8263
Buggy source:
public static boolean consumeFuel(EntityPlayer player,ItemStack stack,double amount,boolean shouldRemove){
  if (amount <= 0) {
    return true;
  }
  double current=getEmc(stack);
  if (current < amount) {
    removeEmc(stack,current);
    amount-=current;
    double consume=EMCHelper.consumePlayerFuel(player,amount);
    if (consume == -1) {
      addEmcToStack(stack,current);
      return false;
    }
    addEmcToStack(stack,consume);
  }
  if (shouldRemove) {
    removeEmc(stack,amount);
  }
  return true;
}

Fixed version (ground truth):
public static boolean consumeFuel(EntityPlayer player,ItemStack stack,double amount,boolean shouldRemove){
  if (amount <= 0) {
    return true;
  }
  double current=getEmc(stack);
  if (current < amount) {
    double consume=EMCHelper.consumePlayerFuel(player,amount - current);
    if (consume == -1) {
      return false;
    }
    addEmcToStack(stack,consume);
  }
  if (shouldRemove) {
    removeEmc(stack,amount);
  }
  return true;
}
Program: 8264
Project: 8264
Buggy source:
private void sendRelayBonus(){
  for (  Map.Entry<ForgeDirection,TileEntity> entry : WorldHelper.getAdjacentTileEntitiesMapped(worldObj,this).entrySet()) {
    ForgeDirection dir=entry.getKey();
    TileEntity tile=entry.getValue();
    if (tile instanceof RelayMK3Tile) {
      double provide=this.provideEMC(dir.getOpposite(),0.5);
      double remain=provide - ((RelayMK3Tile)tile).acceptEMC(dir,provide);
      this.addEMC(remain);
    }
 else     if (tile instanceof RelayMK2Tile) {
      double provide=this.provideEMC(dir.getOpposite(),0.15);
      double remain=provide - ((RelayMK2Tile)tile).acceptEMC(dir,provide);
      this.addEMC(remain);
    }
 else     if (tile instanceof RelayMK1Tile) {
      double provide=this.provideEMC(dir.getOpposite(),0.05);
      double remain=provide - ((RelayMK1Tile)tile).acceptEMC(dir,provide);
      this.addEMC(remain);
    }
  }
}

Fixed version (ground truth):
private void sendRelayBonus(){
  for (  Map.Entry<ForgeDirection,TileEntity> entry : WorldHelper.getAdjacentTileEntitiesMapped(worldObj,this).entrySet()) {
    ForgeDirection dir=entry.getKey();
    TileEntity tile=entry.getValue();
    if (tile instanceof RelayMK3Tile) {
      ((RelayMK3Tile)tile).acceptEMC(dir,0.5);
    }
 else     if (tile instanceof RelayMK2Tile) {
      ((RelayMK2Tile)tile).acceptEMC(dir,0.15);
    }
 else     if (tile instanceof RelayMK1Tile) {
      ((RelayMK1Tile)tile).acceptEMC(dir,0.05);
    }
  }
}
Program: 8265
Project: 8265
Buggy source:
/** 
 * The amount provided will be divided and evenly distributed as best as possible between adjacent IEMCAcceptors Remainder or rejected EMC is added back to this provider
 * @param emc The maximum combined emc to send to others
 */
public void sendToAllAcceptors(double emc){
  if (!(this instanceof IEMCProvider)) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  Map<ForgeDirection,TileEntity> tiles=Maps.filterValues(WorldHelper.getAdjacentTileEntitiesMapped(worldObj,this),Predicates.instanceOf(IEMCAcceptor.class));
  double emcPer=emc / tiles.size();
  for (  Map.Entry<ForgeDirection,TileEntity> entry : tiles.entrySet()) {
    if (this instanceof RelayMK1Tile && entry.getValue() instanceof RelayMK1Tile) {
      continue;
    }
    double provide=((IEMCProvider)this).provideEMC(entry.getKey().getOpposite(),emcPer);
    double remain=provide - ((IEMCAcceptor)entry.getValue()).acceptEMC(entry.getKey(),provide);
    this.addEMC(remain);
  }
}

Fixed version (ground truth):
/** 
 * The amount provided will be divided and evenly distributed as best as possible between adjacent IEMCAcceptors Remainder or rejected EMC is added back to this provider
 * @param emc The maximum combined emc to send to others
 */
public void sendToAllAcceptors(double emc){
  if (!(this instanceof IEmcProvider)) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  Map<ForgeDirection,TileEntity> tiles=Maps.filterValues(WorldHelper.getAdjacentTileEntitiesMapped(worldObj,this),Predicates.instanceOf(IEmcAcceptor.class));
  double emcPer=emc / tiles.size();
  for (  Map.Entry<ForgeDirection,TileEntity> entry : tiles.entrySet()) {
    if (this instanceof RelayMK1Tile && entry.getValue() instanceof RelayMK1Tile) {
      continue;
    }
    double provide=((IEmcProvider)this).provideEMC(entry.getKey().getOpposite(),emcPer);
    double remain=provide - ((IEmcAcceptor)entry.getValue()).acceptEMC(entry.getKey(),provide);
    this.addEMC(remain);
  }
}
Program: 8266
Project: 8266
Buggy source:
public static Map<ForgeDirection,TileEntity> getAdjacentTileEntitiesMapped(final World world,final TileEntity tile){
  Map<ForgeDirection,TileEntity> ret2=Maps.asMap(Sets.newHashSet(ForgeDirection.VALID_DIRECTIONS),new Function<ForgeDirection,TileEntity>(){
    @Nullable @Override public TileEntity apply(    ForgeDirection input){
      return world.getTileEntity(tile.xCoord + input.offsetX,tile.yCoord + input.offsetY,tile.zCoord + input.offsetZ);
    }
  }
);
  return Maps.filterValues(ret2,Predicates.notNull());
}

Fixed version (ground truth):
public static Map<ForgeDirection,TileEntity> getAdjacentTileEntitiesMapped(final World world,final TileEntity tile){
  Map<ForgeDirection,TileEntity> ret2=Maps.asMap(ImmutableSet.copyOf(ForgeDirection.VALID_DIRECTIONS),new Function<ForgeDirection,TileEntity>(){
    @Nullable @Override public TileEntity apply(    ForgeDirection input){
      return world.getTileEntity(tile.xCoord + input.offsetX,tile.yCoord + input.offsetY,tile.zCoord + input.offsetZ);
    }
  }
);
  return Maps.filterValues(ret2,Predicates.notNull());
}
Program: 8267
Project: 8267
Buggy source:
public static List<TileEntity> getAdjacentTileEntities(World world,TileEntity tile){
  return Lists.newArrayList(getAdjacentTileEntitiesMapped(world,tile).values());
}

Fixed version (ground truth):
public static List<TileEntity> getAdjacentTileEntities(World world,TileEntity tile){
  return ImmutableList.copyOf(getAdjacentTileEntitiesMapped(world,tile).values());
}
Program: 8268
Project: 8268
Buggy source:
@Override protected void apply(MovingObjectPosition mop){
  if (!worldObj.isRemote && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
    int x=mop.blockX;
    int y=mop.blockY;
    int z=mop.blockZ;
    Block block=worldObj.getBlock(x,y,z);
    if (block == Blocks.obsidian) {
      PlayerHelper.checkedPlaceBlock(((EntityPlayerMP)getThrower()),x,y,z,Blocks.flowing_lava,0);
    }
 else {
      for (int x1=x - 1; x1 <= x + 1; x1++)       for (int y1=y - 1; y1 <= y + 1; y1++)       for (int z1=z - 1; z1 <= z + 1; z1++) {
        if (worldObj.isAirBlock(x1,y1,z1)) {
          PlayerHelper.checkedPlaceBlock(((EntityPlayerMP)getThrower()),x1,y1,z1,Blocks.fire,0);
        }
 else         if (worldObj.getBlock(x1,y1,z1) == Blocks.sand) {
          PlayerHelper.checkedPlaceBlock(((EntityPlayerMP)getThrower()),x1,y1,z1,Blocks.glass,0);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void apply(MovingObjectPosition mop){
  if (!worldObj.isRemote && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
    int x=mop.blockX;
    int y=mop.blockY;
    int z=mop.blockZ;
    Block block=worldObj.getBlock(x,y,z);
    if (block == Blocks.obsidian) {
      PlayerHelper.checkedReplaceBlock(((EntityPlayerMP)getThrower()),x,y,z,Blocks.flowing_lava,0);
    }
 else {
      for (int x1=x - 1; x1 <= x + 1; x1++)       for (int y1=y - 1; y1 <= y + 1; y1++)       for (int z1=z - 1; z1 <= z + 1; z1++) {
        if (worldObj.isAirBlock(x1,y1,z1)) {
          PlayerHelper.checkedPlaceBlock(((EntityPlayerMP)getThrower()),x1,y1,z1,Blocks.fire,0);
        }
 else         if (worldObj.getBlock(x1,y1,z1) == Blocks.sand) {
          PlayerHelper.checkedReplaceBlock(((EntityPlayerMP)getThrower()),x1,y1,z1,Blocks.glass,0);
        }
      }
    }
  }
}
Program: 8269
Project: 8269
Buggy source:
@Override public void onUpdate(){
  super.onUpdate();
  if (!this.worldObj.isRemote) {
    if (ticksExisted > 400 || !this.worldObj.blockExists(((int)this.posX),((int)this.posY),((int)this.posZ))) {
      this.setDead();
      return;
    }
    boolean flag=true;
    for (int x=(int)(this.posX - 3); x <= this.posX + 3; x++)     for (int y=(int)(this.posY - 3); y <= this.posY + 3; y++)     for (int z=(int)(this.posZ - 3); z <= this.posZ + 3; z++) {
      Block block=this.worldObj.getBlock(x,y,z);
      if (block == Blocks.water || block == Blocks.flowing_water) {
        this.worldObj.setBlockToAir(x,y,z);
        if (flag) {
          this.worldObj.playSoundEffect((double)((float)x + 0.5F),(double)((float)y + 0.5F),(double)((float)z + 0.5F),"String_Node_Str",0.5F,2.6F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.8F);
          flag=false;
        }
      }
    }
    if (this.posY > 128) {
      WorldInfo worldInfo=this.worldObj.getWorldInfo();
      worldInfo.setRaining(false);
      this.setDead();
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  super.onUpdate();
  if (!this.worldObj.isRemote) {
    if (ticksExisted > 400 || !this.worldObj.blockExists(((int)this.posX),((int)this.posY),((int)this.posZ))) {
      this.setDead();
      return;
    }
    boolean flag=true;
    if (getThrower() instanceof EntityPlayerMP) {
      EntityPlayerMP player=((EntityPlayerMP)getThrower());
      for (int x=(int)(this.posX - 3); x <= this.posX + 3; x++)       for (int y=(int)(this.posY - 3); y <= this.posY + 3; y++)       for (int z=(int)(this.posZ - 3); z <= this.posZ + 3; z++) {
        Block block=this.worldObj.getBlock(x,y,z);
        if (block == Blocks.water || block == Blocks.flowing_water) {
          if (PlayerHelper.hasBreakPermission(player,x,y,z)) {
            this.worldObj.setBlockToAir(x,y,z);
          }
          if (flag) {
            this.worldObj.playSoundEffect(x + 0.5,y + 0.5,z + 0.5,"String_Node_Str",0.5F,2.6F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.8F);
            flag=false;
          }
        }
      }
    }
    if (this.posY > 128) {
      WorldInfo worldInfo=this.worldObj.getWorldInfo();
      worldInfo.setRaining(false);
      this.setDead();
    }
  }
}
Program: 8270
Project: 8270
Buggy source:
@Override public void onUpdate(){
  super.onUpdate();
  if (!this.worldObj.isRemote) {
    if (ticksExisted > 400 || !this.worldObj.blockExists(((int)this.posX),((int)this.posY),((int)this.posZ))) {
      this.setDead();
      return;
    }
    for (int x=(int)(this.posX - 3); x <= this.posX + 3; x++)     for (int y=(int)(this.posY - 3); y <= this.posY + 3; y++)     for (int z=(int)(this.posZ - 3); z <= this.posZ + 3; z++) {
      Block block=this.worldObj.getBlock(x,y,z);
      boolean flag=false;
      if (block == Blocks.lava) {
        this.worldObj.setBlock(x,y,z,Blocks.obsidian);
      }
 else       if (block == Blocks.flowing_lava) {
        this.worldObj.setBlock(x,y,z,Blocks.cobblestone);
      }
 else {
        continue;
      }
      this.worldObj.playSoundEffect((double)((float)x + 0.5F),(double)((float)y + 0.5F),(double)((float)z + 0.5F),"String_Node_Str",0.5F,2.6F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.8F);
    }
    if (this.isInWater()) {
      this.setDead();
    }
    if (this.posY > 128) {
      WorldInfo worldInfo=this.worldObj.getWorldInfo();
      worldInfo.setRaining(true);
      this.setDead();
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  super.onUpdate();
  if (!this.worldObj.isRemote) {
    if (ticksExisted > 400 || !this.worldObj.blockExists(((int)this.posX),((int)this.posY),((int)this.posZ))) {
      this.setDead();
      return;
    }
    if (getThrower() instanceof EntityPlayerMP) {
      EntityPlayerMP player=((EntityPlayerMP)getThrower());
      for (int x=(int)(this.posX - 3); x <= this.posX + 3; x++)       for (int y=(int)(this.posY - 3); y <= this.posY + 3; y++)       for (int z=(int)(this.posZ - 3); z <= this.posZ + 3; z++) {
        Block block=this.worldObj.getBlock(x,y,z);
        if (block == Blocks.lava) {
          PlayerHelper.checkedReplaceBlock(player,x,y,z,Blocks.obsidian,0);
        }
 else         if (block == Blocks.flowing_lava) {
          PlayerHelper.checkedReplaceBlock(player,x,y,z,Blocks.cobblestone,0);
        }
        this.worldObj.playSoundEffect(x + 0.5,y + 0.5,z + 0.5,"String_Node_Str",0.5F,2.6F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.8F);
      }
    }
    if (this.isInWater()) {
      this.setDead();
    }
    if (this.posY > 128) {
      WorldInfo worldInfo=this.worldObj.getWorldInfo();
      worldInfo.setRaining(true);
      this.setDead();
    }
  }
}
Program: 8272
Project: 8272
Buggy source:
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int sideHit,float f1,float f2,float f3){
  if (!world.isRemote && PlayerHelper.hasEditPermission(world,((EntityPlayerMP)player),x,y,z)) {
    TileEntity tile=world.getTileEntity(x,y,z);
    if (tile instanceof IFluidHandler) {
      IFluidHandler tank=(IFluidHandler)tile;
      if (FluidHelper.canFillTank(tank,FluidRegistry.WATER,sideHit)) {
        FluidHelper.fillTank(tank,FluidRegistry.WATER,sideHit,1000);
        return true;
      }
    }
    Block block=world.getBlock(x,y,z);
    int meta=world.getBlockMetadata(x,y,z);
    if (block == Blocks.cauldron && meta < 3) {
      ((BlockCauldron)block).func_150024_a(world,x,y,z,meta + 1);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int sideHit,float f1,float f2,float f3){
  if (!world.isRemote && PlayerHelper.hasEditPermission(((EntityPlayerMP)player),x,y,z)) {
    TileEntity tile=world.getTileEntity(x,y,z);
    if (tile instanceof IFluidHandler) {
      IFluidHandler tank=(IFluidHandler)tile;
      if (FluidHelper.canFillTank(tank,FluidRegistry.WATER,sideHit)) {
        FluidHelper.fillTank(tank,FluidRegistry.WATER,sideHit,1000);
        return true;
      }
    }
    Block block=world.getBlock(x,y,z);
    int meta=world.getBlockMetadata(x,y,z);
    if (block == Blocks.cauldron && meta < 3) {
      ((BlockCauldron)block).func_150024_a(world,x,y,z,meta + 1);
    }
  }
  return false;
}
Program: 8274
Project: 8274
Buggy source:
private void changeBlock(World world,MetaBlock pointed,MetaBlock result,int x,int y,int z,EntityPlayer player){
  MetaBlock block=new MetaBlock(world,x,y,z);
  if (block.equals(pointed)) {
    PlayerHelper.checkedPlaceBlock(((EntityPlayerMP)player),x,y,z,result.getBlock(),result.getMeta());
    if (world.rand.nextInt(8) == 0) {
      PacketHandler.sendToAllAround(new ParticlePKT("String_Node_Str",x,y + 1,z),new TargetPoint(world.provider.dimensionId,x,y + 1,z,32));
    }
  }
}

Fixed version (ground truth):
private void changeBlock(World world,MetaBlock pointed,MetaBlock result,int x,int y,int z,EntityPlayer player){
  MetaBlock block=new MetaBlock(world,x,y,z);
  if (block.equals(pointed)) {
    PlayerHelper.checkedReplaceBlock(((EntityPlayerMP)player),x,y,z,result.getBlock(),result.getMeta());
    if (world.rand.nextInt(8) == 0) {
      PacketHandler.sendToAllAround(new ParticlePKT("String_Node_Str",x,y + 1,z),new TargetPoint(world.provider.dimensionId,x,y + 1,z,32));
    }
  }
}
Program: 8275
Project: 8275
Buggy source:
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int sideHit,float f1,float f2,float f3){
  if (!world.isRemote && PlayerHelper.hasEditPermission(world,((EntityPlayerMP)player),x,y,z)) {
    TileEntity tile=world.getTileEntity(x,y,z);
    if (tile instanceof IFluidHandler) {
      IFluidHandler tank=(IFluidHandler)tile;
      if (FluidHelper.canFillTank(tank,FluidRegistry.LAVA,sideHit)) {
        if (consumeFuel(player,stack,32.0F,true)) {
          FluidHelper.fillTank(tank,FluidRegistry.LAVA,sideHit,1000);
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int sideHit,float f1,float f2,float f3){
  if (!world.isRemote && PlayerHelper.hasEditPermission(((EntityPlayerMP)player),x,y,z)) {
    TileEntity tile=world.getTileEntity(x,y,z);
    if (tile instanceof IFluidHandler) {
      IFluidHandler tank=(IFluidHandler)tile;
      if (FluidHelper.canFillTank(tank,FluidRegistry.LAVA,sideHit)) {
        if (consumeFuel(player,stack,32.0F,true)) {
          FluidHelper.fillTank(tank,FluidRegistry.LAVA,sideHit,1000);
          return true;
        }
      }
    }
  }
  return false;
}