// Path: src/main/java/tonius/neiintegration/IntegrationBase.java
// public abstract class IntegrationBase {
//     
//     public abstract String getName();
//     
//     public boolean isEnabledByDefault() {
//         return true;
//     }
//     
//     public abstract boolean isValid();
//     
//     public abstract void loadConfig();
//     
//     protected void registerHandler(IRecipeHandler handler) {
//         handler.prepare();
//         API.registerRecipeHandler(handler);
//         API.registerUsageHandler(handler);
//     }
//     
// }
// 
// Path: src/main/java/tonius/neiintegration/NEIIntegration.java
// @Mod(modid = NEIIntegration.MODID, version = NEIIntegration.VERSION, acceptableRemoteVersions = NEIIntegration.ACCEPTABLE_REMOTE_VERSIONS, guiFactory = NEIIntegration.GUI_FACTORY)
// public class NEIIntegration {
//     
//     public static final String MODID = "neiintegration";
//     public static final String VERSION = "@VERSION@";
//     public static final String ACCEPTABLE_REMOTE_VERSIONS = "*";
//     public static final String GUI_FACTORY = "tonius.neiintegration.config.ConfigGuiFactory";
//     
//     @Instance(MODID)
//     public static NEIIntegration instance;
//     public static Logger log;
//     public static List<IntegrationBase> integrations;
//     
//     @EventHandler
//     public void preInit(FMLPreInitializationEvent evt) {
//         if (evt.getSide() != Side.CLIENT) {
//             return;
//         }
//         
//         log = evt.getModLog();
//         log.info("Starting NEI Integration");
//         
//         integrations = Integrations.getIntegrations();
//         Config.preInit(evt);
//     }
//     
// }


import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraftforge.common.config.Configuration;
import tonius.neiintegration.IntegrationBase;
import tonius.neiintegration.NEIIntegration;
import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    public static boolean tooltipFluidRegInfoShift = Defaults.tooltipFluidRegInfoShift;
    public static boolean tooltipFluidRegInfoAdvanced = Defaults.tooltipFluidRegInfoAdvanced;
    
    public static void preInit(FMLPreInitializationEvent evt) {
        FMLCommonHandler.instance().bus().register(new Config());
        config = new Configuration(new File(evt.getModConfigurationDirectory(), NEIIntegration.MODID + ".cfg"));
        syncConfig();
    }
    
    public static void syncConfig() {
        NEIIntegration.log.info("Loading configuration files");
        try {
            processConfig();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (config.hasChanged()) {
                config.save();
            }
        }
    }
    
    @SubscribeEvent
    public void onConfigChanged(OnConfigChangedEvent evt) {
        if (evt.modID.equals(NEIIntegration.MODID)) {
            syncConfig();
        }
    }
    
    public static void processConfig() {
// Path: src/main/java/tonius/neiintegration/IntegrationBase.java
// public abstract class IntegrationBase {
//     
//     public abstract String getName();
//     
//     public boolean isEnabledByDefault() {
//         return true;
//     }
//     
//     public abstract boolean isValid();
//     
//     public abstract void loadConfig();
//     
//     protected void registerHandler(IRecipeHandler handler) {
//         handler.prepare();
//         API.registerRecipeHandler(handler);
//         API.registerUsageHandler(handler);
//     }
//     
// }
// 
// Path: src/main/java/tonius/neiintegration/NEIIntegration.java
// @Mod(modid = NEIIntegration.MODID, version = NEIIntegration.VERSION, acceptableRemoteVersions = NEIIntegration.ACCEPTABLE_REMOTE_VERSIONS, guiFactory = NEIIntegration.GUI_FACTORY)
// public class NEIIntegration {
//     
//     public static final String MODID = "neiintegration";
//     public static final String VERSION = "@VERSION@";
//     public static final String ACCEPTABLE_REMOTE_VERSIONS = "*";
//     public static final String GUI_FACTORY = "tonius.neiintegration.config.ConfigGuiFactory";
//     
//     @Instance(MODID)
//     public static NEIIntegration instance;
//     public static Logger log;
//     public static List<IntegrationBase> integrations;
//     
//     @EventHandler
//     public void preInit(FMLPreInitializationEvent evt) {
//         if (evt.getSide() != Side.CLIENT) {
//             return;
//         }
//         
//         log = evt.getModLog();
//         log.info("Starting NEI Integration");
//         
//         integrations = Integrations.getIntegrations();
//         Config.preInit(evt);
//     }
//     
// }


// Path: src/main/java/tonius/neiintegration/config/Config.java
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraftforge.common.config.Configuration;
import tonius.neiintegration.IntegrationBase;
import tonius.neiintegration.NEIIntegration;
import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

    public static boolean tooltipFluidRegInfoShift = Defaults.tooltipFluidRegInfoShift;
    public static boolean tooltipFluidRegInfoAdvanced = Defaults.tooltipFluidRegInfoAdvanced;
    
    public static void preInit(FMLPreInitializationEvent evt) {
        FMLCommonHandler.instance().bus().register(new Config());
        config = new Configuration(new File(evt.getModConfigurationDirectory(), NEIIntegration.MODID + ".cfg"));
        syncConfig();
    }
    
    public static void syncConfig() {
        NEIIntegration.log.info("Loading configuration files");
        try {
            processConfig();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (config.hasChanged()) {
                config.save();
            }
        }
    }
    
    @SubscribeEvent
    public void onConfigChanged(OnConfigChangedEvent evt) {
        if (evt.modID.equals(NEIIntegration.MODID)) {
            syncConfig();
        }
    }
    
    public static void processConfig() {
        for (Iterator<IntegrationBase> itr = NEIIntegration.integrations.iterator(); itr.hasNext();) {