public static void update(LauncherAPI api)
    {
        for (final GameFile file : api.getUpdater().getGameFiles())
        {
            try
            {
                file.init();
                api.getUpdater().incrementTotalSize(file.getSize());
            }
            catch (final Exception e)
            {
                e.printStackTrace();
            }
        }
        
        // Downloading packages
        api.getUpdater().setState(State.DOWNLOADING);
        api.getUpdater().setPercentage(10);
        for (final GameFile file : api.getUpdater().getGameFiles())
        {
            api.getUpdater().setCurrentFile(file);
            try
            {
                file.download(api);
            }
            catch (final Exception e)
            {
                e.printStackTrace();
            }
        }
        api.getUpdater().setCurrentFile(null);
        
        // Extracting packages
        api.getUpdater().setState(State.EXTRACTING_PACKAGES);
        api.getUpdater().setPercentage(55);
        
        final int percentageStep = 20 / api.getUpdater().getGameFiles().size();
        
        for (int i = 0; i < api.getUpdater().getGameFiles().size(); i++)
        {
            final GameFile file = api.getUpdater().getGameFiles().get(i);
            api.getUpdater().setCurrentFile(file);
            final int min = 55 + i * percentageStep;
            final int max = 55 + (i + 1) * percentageStep;
            file.extract(api, min, max);
        }
        api.getUpdater().setCurrentFile(null);
    }