// Path: src/main/java/guichaguri/betterfps/BetterFps.java
// public class BetterFps {
// 
//     public static final String MC_VERSION = "1.12";
//     public static final String VERSION = "1.4.7";
//     public static final String URL = "http://guichaguri.github.io/BetterFps/";
//     public static final String UPDATE_URL = "http://widget.mcf.li/mc-mods/minecraft/229876-betterfps.json";
// 
//     public static boolean CLIENT = false;
//     public static File GAME_DIR = null;
// 
// }
// 
// Path: src/main/java/guichaguri/betterfps/BetterFpsHelper.java
// public class BetterFpsHelper {
// 
//     public static final Logger LOG = LogManager.getLogger("BetterFps");
// 
//     private static BetterFpsConfig INSTANCE = null;
//     private static File CONFIG_FILE = null;
// 
//     public static BetterFpsConfig getConfig() {
//         if(INSTANCE == null) loadConfig();
//         return INSTANCE;
//     }
// 
//     public static void loadConfig() {
//         File configPath;
//         if(BetterFps.GAME_DIR == null) {
//             configPath = new File("config");
//         } else {
//             configPath = new File(BetterFps.GAME_DIR, "config");
//         }
// 
//         CONFIG_FILE = new File(configPath, "betterfps.json");
// 
//         // Temporary code - Import old config file to the new one
//         File oldConfig;
//         if(BetterFps.GAME_DIR == null) {
//             oldConfig = new File("config" + File.pathSeparator + "betterfps.json");
//         } else {
//             oldConfig = new File(BetterFps.GAME_DIR, "config" + File.pathSeparator + "betterfps.json");
//         }
//         if(oldConfig.exists()) {
//             FileReader reader = null;
//             try {
//                 reader = new FileReader(oldConfig);
//                 INSTANCE = new Gson().fromJson(reader, BetterFpsConfig.class);
//                 saveConfig();
//                 return;
//             } catch(Exception ex) {
//                 LOG.error("Could not load the old config file. It will be deleted.");
//             } finally {
//                 IOUtils.closeQuietly(reader);
//                 oldConfig.deleteOnExit();
//             }
//         }
//         // -------
// 
//         FileReader reader = null;
//         try {
//             if(CONFIG_FILE.exists()) {
//                 reader = new FileReader(CONFIG_FILE);
//                 INSTANCE = new Gson().fromJson(reader, BetterFpsConfig.class);
//             }
//         } catch(Exception ex) {
//             LOG.error("Could not load the config file", ex);
//         } finally {
//             IOUtils.closeQuietly(reader);
//         }
// 
//         if(INSTANCE == null) INSTANCE = new BetterFpsConfig();
// 
//         saveConfig();
//     }
// 
//     public static void saveConfig() {
//         FileWriter writer = null;
//         try {
//             if(!CONFIG_FILE.exists()) CONFIG_FILE.getParentFile().mkdirs();
//             writer = new FileWriter(CONFIG_FILE);
//             new Gson().toJson(INSTANCE, writer);
//         } catch(Exception ex) {
//             LOG.error("Could not save the config file", ex);
//         } finally {
//             IOUtils.closeQuietly(writer);
//         }
//     }
// 
// }


import guichaguri.betterfps.BetterFps;
import guichaguri.betterfps.BetterFpsHelper;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;

    private final String[] EXCLUDED = new String[] {
            "guichaguri.betterfps.transformers",
            "guichaguri.betterfps.tweaker",
            "guichaguri.betterfps.patchers"
    };

    private final String[] LOAD_DISABLED = new String[] {
            "guichaguri.betterfps.installer",
            "guichaguri.betterfps.math",
            "guichaguri.betterfps.patches"
    };

    private List<String> args;

    @Override
    public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
        this.args = new ArrayList<String>(args);

        this.args.add("--version");
        this.args.add(profile);

        if(assetsDir != null) {
            this.args.add("--assetsDir");
            this.args.add(assetsDir.getAbsolutePath());
        }
        if(gameDir != null) {
            this.args.add("--gameDir");
            this.args.add(gameDir.getAbsolutePath());
        }


// Path: src/main/java/guichaguri/betterfps/BetterFps.java
// public class BetterFps {
// 
//     public static final String MC_VERSION = "1.12";
//     public static final String VERSION = "1.4.7";
//     public static final String URL = "http://guichaguri.github.io/BetterFps/";
//     public static final String UPDATE_URL = "http://widget.mcf.li/mc-mods/minecraft/229876-betterfps.json";
// 
//     public static boolean CLIENT = false;
//     public static File GAME_DIR = null;
// 
// }
// 
// Path: src/main/java/guichaguri/betterfps/BetterFpsHelper.java
// public class BetterFpsHelper {
// 
//     public static final Logger LOG = LogManager.getLogger("BetterFps");
// 
//     private static BetterFpsConfig INSTANCE = null;
//     private static File CONFIG_FILE = null;
// 
//     public static BetterFpsConfig getConfig() {
//         if(INSTANCE == null) loadConfig();
//         return INSTANCE;
//     }
// 
//     public static void loadConfig() {
//         File configPath;
//         if(BetterFps.GAME_DIR == null) {
//             configPath = new File("config");
//         } else {
//             configPath = new File(BetterFps.GAME_DIR, "config");
//         }
// 
//         CONFIG_FILE = new File(configPath, "betterfps.json");
// 
//         // Temporary code - Import old config file to the new one
//         File oldConfig;
//         if(BetterFps.GAME_DIR == null) {
//             oldConfig = new File("config" + File.pathSeparator + "betterfps.json");
//         } else {
//             oldConfig = new File(BetterFps.GAME_DIR, "config" + File.pathSeparator + "betterfps.json");
//         }
//         if(oldConfig.exists()) {
//             FileReader reader = null;
//             try {
//                 reader = new FileReader(oldConfig);
//                 INSTANCE = new Gson().fromJson(reader, BetterFpsConfig.class);
//                 saveConfig();
//                 return;
//             } catch(Exception ex) {
//                 LOG.error("Could not load the old config file. It will be deleted.");
//             } finally {
//                 IOUtils.closeQuietly(reader);
//                 oldConfig.deleteOnExit();
//             }
//         }
//         // -------
// 
//         FileReader reader = null;
//         try {
//             if(CONFIG_FILE.exists()) {
//                 reader = new FileReader(CONFIG_FILE);
//                 INSTANCE = new Gson().fromJson(reader, BetterFpsConfig.class);
//             }
//         } catch(Exception ex) {
//             LOG.error("Could not load the config file", ex);
//         } finally {
//             IOUtils.closeQuietly(reader);
//         }
// 
//         if(INSTANCE == null) INSTANCE = new BetterFpsConfig();
// 
//         saveConfig();
//     }
// 
//     public static void saveConfig() {
//         FileWriter writer = null;
//         try {
//             if(!CONFIG_FILE.exists()) CONFIG_FILE.getParentFile().mkdirs();
//             writer = new FileWriter(CONFIG_FILE);
//             new Gson().toJson(INSTANCE, writer);
//         } catch(Exception ex) {
//             LOG.error("Could not save the config file", ex);
//         } finally {
//             IOUtils.closeQuietly(writer);
//         }
//     }
// 
// }


// Path: src/main/java/guichaguri/betterfps/tweaker/BetterFpsTweaker.java
import guichaguri.betterfps.BetterFps;
import guichaguri.betterfps.BetterFpsHelper;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;

    private final String[] EXCLUDED = new String[] {
            "guichaguri.betterfps.transformers",
            "guichaguri.betterfps.tweaker",
            "guichaguri.betterfps.patchers"
    };

    private final String[] LOAD_DISABLED = new String[] {
            "guichaguri.betterfps.installer",
            "guichaguri.betterfps.math",
            "guichaguri.betterfps.patches"
    };

    private List<String> args;

    @Override
    public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
        this.args = new ArrayList<String>(args);

        this.args.add("--version");
        this.args.add(profile);

        if(assetsDir != null) {
            this.args.add("--assetsDir");
            this.args.add(assetsDir.getAbsolutePath());
        }
        if(gameDir != null) {
            this.args.add("--gameDir");
            this.args.add(gameDir.getAbsolutePath());
        }


        BetterFps.GAME_DIR = gameDir;
