mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 03:05:10 +00:00
Update the package name
This commit is contained in:
1 parent
2fbed929c5
commit
27c532a4fc
139 files changed
+577
-500
No files matched your search
@@ -1,49 +0,0 @@
|
||||
package info.jbcs.minecraft.chisel.compat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user