package com.mcmoddev.modernmetals.integration;

import com.google.common.collect.Lists;
import com.mcmoddev.lib.integration.IIntegration;
import com.mcmoddev.lib.util.AnnotationChecker;

import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import java.util.List;

public enum IntegrationManager {
    INSTANCE;

    private List<IIntegration> integrations = Lists.newArrayList();

    public void preInit(FMLPreInitializationEvent event) {
        AnnotationChecker.getInstances(event.getAsmData(), ModernMetalsPlugin.class, IIntegration.class).stream()
                .forEachOrdered(integration -> {
                    Class<? extends IIntegration> integrationClass = integration.getClass();
                    ModernMetalsPlugin plugin = integrationClass.getAnnotation(ModernMetalsPlugin.class);
                    if (Loader.isModLoaded(plugin.value())) {
                    	FMLLog.severe("MODERNMETALS: Loaded " + plugin.value());
                        integrations.add(integration);
                        integration.init();
                    }
                });
    }
}
@@ -105,35 +105,97 @@
 dev.
-lib.integration.IIntegratio
+modernmetals.ModernMetals;%0Aimport com.mcmoddev.modernmetals.integration.ModernMetalsPlugi
 n;%0Ai
@@ -221,30 +221,32 @@
 lib.
-util.AnnotationChecker
+integration.IIntegration
 ;%0A%0Ai
@@ -281,22 +281,22 @@
 .common.
-FMLLog
+Loader
 ;%0Aimport
@@ -318,38 +318,62 @@
 orge.fml.common.
-Loader
+discovery.ASMDataTable.ASMData
 ;%0Aimport net.min
@@ -637,43 +637,42 @@
     
-    AnnotationChecker.getInstances(
+%09for( final ASMData asmDataItem : 
 even
@@ -685,18 +685,24 @@
 smData()
-, 
+.getAll(
 ModernMe
@@ -721,124 +721,210 @@
 lass
-, IIntegration.class).stream
+.getCanonicalName()) ) %7B%0A    %09%09String modId = asmDataItem.getAnnotationInfo().get(%22value%22).toString
 ()
+;
 %0A    
-            .forEachOrdered(integration -%3E %7B%0A                    Class%3C? extends 
+%09%09String className = asmDataItem.getClassName();%0A    %09%09if (Loader.isModLoaded(modId)) %7B%0A    %09%09%09
 IInt
@@ -923,33 +923,32 @@
  %09%09%09IIntegration
-%3E
  integrationClas
@@ -947,16 +947,25 @@
 tion
-Class = 
+;%0A%09%09%09%09try %7B%0A%09%09%09%09%09
 inte
@@ -975,70 +975,49 @@
 tion
-.get
+ = 
 Class
-();%0A                    ModernMetalsPlugin plugin = i
+.forName(className).asSubclass(II
 nteg
@@ -1026,151 +1026,60 @@
 tion
-C
+.c
 lass
-.getAnnotation(ModernMetalsPlugin.class);%0A                    if (Loader.isModLoaded(plugin.value())) %7B%0A                    %09FMLLog.severe
+).newInstance();%0A%09%09%09%09%09ModernMetals.logger.info
 (%22MO
@@ -1092,178 +1092,162 @@
 TALS
-:
  Loaded
+:
  %22
- + plugin.value());%0A                        integrations.add(integration);%0A                        integration.init();%0A                    %7D%0A                %7D);
++modId);%0A%09%09%09%09%09integrations.add(integration);%0A%09%09%09%09%09integration.init();%0A%09%09%09%09%7D catch (final Exception e) %7B%0A%09%09%09%09%09// do nothing %0A%09%09%09%09%7D%0A    %09%09%7D%0A    %09%7D
 %0A   

Make MMe match BMe and remove references to the removed AnnotationChecker class