mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-20 04:19:44 +00:00
31 lines
667 B
Java
31 lines
667 B
Java
package modtweaker2.utils;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import cpw.mods.fml.common.Loader;
|
|
|
|
public class TweakerPlugin {
|
|
|
|
private static ArrayList<String> isLoaded = new ArrayList<String>();
|
|
|
|
public static void register(String mod, Class<?> clazz) {
|
|
if (Loader.isModLoaded(mod)) {
|
|
load(mod, clazz);
|
|
}
|
|
}
|
|
|
|
public static void load(String mod, Class<?> clazz) {
|
|
try {
|
|
clazz.newInstance();
|
|
isLoaded.add(mod);
|
|
} catch (Exception e) {
|
|
isLoaded.remove(mod);
|
|
}
|
|
}
|
|
|
|
public static boolean isLoaded(String string) {
|
|
return isLoaded.contains(string);
|
|
}
|
|
|
|
}
|