Program: 21804
Project: 21804
Buggy source:
@Override public ItemStack onItemRightClick(ItemStack itemStack,World world,EntityPlayer player){
  boolean flag=itemStack.getItemDamage() == ElementEnum.heaviestMass;
  MovingObjectPosition movingObjectPosition=this.getMovingObjectPositionFromPlayer(world,player,flag);
  if (!player.capabilities.isCreativeMode && itemStack.stackSize < 8)   MinechemUtil.scanForMoreStacks(itemStack,player);
  if (movingObjectPosition == null || (itemStack.stackSize < 8 && !player.capabilities.isCreativeMode)) {
    return itemStack;
  }
  if (movingObjectPosition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
    int blockX=movingObjectPosition.blockX;
    int blockY=movingObjectPosition.blockY;
    int blockZ=movingObjectPosition.blockZ;
    Block block=world.getBlock(blockX,blockY,blockZ);
    if (flag) {
      MinechemChemicalType chemical=MinechemUtil.getChemical(block);
      if (chemical != null && MinechemUtil.canDrain(world,block,blockX,blockY,blockZ)) {
        ItemStack stack=MinechemUtil.createItemStack(chemical,1);
        if (stack != null) {
          stack.stackSize=8;
          TileEntity tile=world.getTileEntity(blockX,blockY,blockZ);
          if (tile instanceof RadiationFluidTileEntity && ((RadiationFluidTileEntity)tile).info != null) {
            setRadiationInfo(((RadiationFluidTileEntity)tile).info,stack);
          }
          world.setBlockToAir(blockX,blockY,blockZ);
          world.removeTileEntity(blockX,blockY,blockZ);
          return fillTube(itemStack,player,stack);
        }
      }
    }
 else {
      ForgeDirection dir=ForgeDirection.getOrientation(movingObjectPosition.sideHit);
      blockX+=dir.offsetX;
      blockY+=dir.offsetY;
      blockZ+=dir.offsetZ;
      if (!player.canPlayerEdit(blockX,blockY,blockZ,movingObjectPosition.sideHit,itemStack)) {
        return itemStack;
      }
      return emptyTube(itemStack,player,world,blockX,blockY,blockZ);
    }
  }
  return itemStack;
}

Fixed version (ground truth):
@Override public ItemStack onItemRightClick(ItemStack itemStack,World world,EntityPlayer player){
  boolean flag=itemStack.getItemDamage() == ElementEnum.heaviestMass;
  MovingObjectPosition movingObjectPosition=this.getMovingObjectPositionFromPlayer(world,player,flag);
  if (movingObjectPosition == null || player.capabilities.isCreativeMode) {
    return itemStack;
  }
  if (movingObjectPosition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
    int blockX=movingObjectPosition.blockX;
    int blockY=movingObjectPosition.blockY;
    int blockZ=movingObjectPosition.blockZ;
    Block block=world.getBlock(blockX,blockY,blockZ);
    if (flag) {
      MinechemChemicalType chemical=MinechemUtil.getChemical(block);
      if (chemical != null && MinechemUtil.canDrain(world,block,blockX,blockY,blockZ)) {
        ItemStack stack=MinechemUtil.createItemStack(chemical,1);
        if (stack != null) {
          stack.stackSize=8;
          TileEntity tile=world.getTileEntity(blockX,blockY,blockZ);
          if (tile instanceof RadiationFluidTileEntity && ((RadiationFluidTileEntity)tile).info != null) {
            setRadiationInfo(((RadiationFluidTileEntity)tile).info,stack);
          }
          world.setBlockToAir(blockX,blockY,blockZ);
          world.removeTileEntity(blockX,blockY,blockZ);
          return fillTube(itemStack,player,stack);
        }
      }
    }
 else {
      ForgeDirection dir=ForgeDirection.getOrientation(movingObjectPosition.sideHit);
      blockX+=dir.offsetX;
      blockY+=dir.offsetY;
      blockZ+=dir.offsetZ;
      if (!player.canPlayerEdit(blockX,blockY,blockZ,movingObjectPosition.sideHit,itemStack)) {
        return itemStack;
      }
      return emptyTube(itemStack,player,world,blockX,blockY,blockZ);
    }
  }
  return itemStack;
}