Program: 21803
Project: 21803
Buggy source:
private ItemStack emptyTube(ItemStack itemStack,EntityPlayer player,World world,int x,int y,int z){
  if (!world.isAirBlock(x,y,z) && !world.getBlock(x,y,z).getMaterial().isSolid()) {
    Block sourceBlock=world.getBlock(x,y,z);
    int metadata=world.getBlockMetadata(x,y,z);
    sourceBlock.harvestBlock(world,player,x,y,z,metadata);
    sourceBlock.breakBlock(world,x,y,z,sourceBlock,metadata);
    world.setBlockToAir(x,y,z);
  }
  if (world.isAirBlock(x,y,z)) {
    RadiationEnum radioactivity=ElementEnum.elements.get(itemStack.getItemDamage()).radioactivity();
    if (!player.capabilities.isCreativeMode) {
      if (itemStack.stackSize >= 8) {
        itemStack.stackSize-=8;
      }
 else {
        int needs=8 - itemStack.stackSize;
        itemStack.stackSize=0;
        Set<ItemStack> otherItemsStacks=MinechemUtil.findItemStacks(player.inventory,itemStack.getItem(),itemStack.getItemDamage());
        otherItemsStacks.remove(itemStack);
        int free=0;
        Iterator<ItemStack> it2=otherItemsStacks.iterator();
        while (it2.hasNext()) {
          ItemStack stack=it2.next();
          free+=stack.stackSize;
        }
        if (free < needs) {
          return itemStack;
        }
        Iterator<ItemStack> it=otherItemsStacks.iterator();
        while (it.hasNext()) {
          ItemStack stack=it.next();
          RadiationEnum anotherRadiation=getRadioactivity(stack);
          if (anotherRadiation.getLife() < radioactivity.getLife()) {
            radioactivity=anotherRadiation;
          }
          if (stack.stackSize >= needs) {
            stack.stackSize-=needs;
            needs=0;
            break;
          }
 else {
            needs-=stack.stackSize;
            stack.stackSize=0;
          }
        }
      }
      ItemStack empties=MinechemUtil.addItemToInventory(player.inventory,new ItemStack(MinechemItemsRegistration.element,8,ElementEnum.heaviestMass));
      MinechemUtil.throwItemStack(world,empties,x,y,z);
    }
    Block block=FluidHelper.elementsBlocks.get(FluidHelper.elements.get(getElement(itemStack)));
    world.setBlock(x,y,z,block,0,3);
    TileEntity tile=world.getTileEntity(x,y,z);
    if (radioactivity != RadiationEnum.stable && tile instanceof RadiationFluidTileEntity) {
      ((RadiationFluidTileEntity)tile).info=getRadiationInfo(itemStack,world);
    }
  }
  return itemStack;
}

Fixed version (ground truth):
private ItemStack emptyTube(ItemStack itemStack,EntityPlayer player,World world,int x,int y,int z){
  if (!world.isAirBlock(x,y,z) && !world.getBlock(x,y,z).getMaterial().isSolid()) {
    Block sourceBlock=world.getBlock(x,y,z);
    int metadata=world.getBlockMetadata(x,y,z);
    sourceBlock.harvestBlock(world,player,x,y,z,metadata);
    sourceBlock.breakBlock(world,x,y,z,sourceBlock,metadata);
    world.setBlockToAir(x,y,z);
  }
  if (world.isAirBlock(x,y,z)) {
    RadiationInfo radioactivity=getRadiationInfo(itemStack,world);
    long worldtime=world.getTotalWorldTime();
    long leftTime=radioactivity.radioactivity.getLife() - (worldtime - radioactivity.decayStarted);
    if (!player.capabilities.isCreativeMode) {
      if (itemStack.stackSize >= 8) {
        itemStack.stackSize-=8;
      }
 else {
        int needs=8 - itemStack.stackSize;
        itemStack.stackSize=0;
        Set<ItemStack> otherItemsStacks=MinechemUtil.findItemStacks(player.inventory,itemStack.getItem(),itemStack.getItemDamage());
        otherItemsStacks.remove(itemStack);
        int free=0;
        Iterator<ItemStack> it2=otherItemsStacks.iterator();
        while (it2.hasNext()) {
          ItemStack stack=it2.next();
          free+=stack.stackSize;
        }
        if (free < needs) {
          return itemStack;
        }
        Iterator<ItemStack> it=otherItemsStacks.iterator();
        while (it.hasNext()) {
          ItemStack stack=it.next();
          RadiationInfo anotherRadiation=getRadiationInfo(stack,world);
          long anotherLeft=anotherRadiation.radioactivity.getLife() - (worldtime - anotherRadiation.decayStarted);
          if (anotherLeft < leftTime) {
            radioactivity=anotherRadiation;
            leftTime=anotherLeft;
          }
          if (stack.stackSize >= needs) {
            stack.stackSize-=needs;
            needs=0;
          }
 else {
            needs-=stack.stackSize;
            stack.stackSize=0;
          }
          if (stack.stackSize <= 0) {
            MinechemUtil.removeStackInInventory(player.inventory,stack);
          }
          if (needs == 0) {
            break;
          }
        }
      }
      ItemStack empties=MinechemUtil.addItemToInventory(player.inventory,new ItemStack(MinechemItemsRegistration.element,8,ElementEnum.heaviestMass));
      MinechemUtil.throwItemStack(world,empties,x,y,z);
    }
    Block block=FluidHelper.elementsBlocks.get(FluidHelper.elements.get(getElement(itemStack)));
    world.setBlock(x,y,z,block,0,3);
    TileEntity tile=world.getTileEntity(x,y,z);
    if (radioactivity.isRadioactive() && tile instanceof RadiationFluidTileEntity) {
      ((RadiationFluidTileEntity)tile).info=radioactivity;
    }
  }
  return itemStack;
}