The Great Refractor!

This commit is contained in:
TheCricket committed 2014-10-28 21:10:08 -04:00
1 parent aa52debeb5
commit 5b5e29a8ce
92 files changed
+1616 -1452

No files matched your search

@@ -0,0 +1,49 @@
package info.jbcs.minecraft.chisel.compat;
import cpw.mods.fml.common.Loader;
import java.util.ArrayList;
import java.util.List;
public class ModIntegration {
private static List<IModIntegration> integratedMods = new ArrayList<IModIntegration>();
public static void addMod(Class<? extends IModIntegration> cls){
try{
IModIntegration obj = cls.newInstance();
if(Loader.isModLoaded(obj.getModId())){
integratedMods.add(obj);
}
} catch(Throwable throwable){
throwable.printStackTrace();
}
}
public static void init(){
try{
for(IModIntegration integration : integratedMods){
integration.onInit();
}
} catch (Throwable throwable){
throwable.printStackTrace();
}
}
public static void postInit(){
try {
for (IModIntegration integration : integratedMods){
integration.onPostInit();
}
} catch (Throwable throwable){
throwable.printStackTrace();
}
}
static interface IModIntegration{
String getModId();
void onInit();
void onPostInit();
}
}