Improvements to the compat manager.
This commit is contained in:
parent
a5024d56d0
commit
ebc685ba3d
1 changed files with 17 additions and 4 deletions
|
@ -28,11 +28,24 @@ public class CompatManager {
|
|||
registerCompact(MinetweakerCompat.class, "MineTweaker3");
|
||||
}
|
||||
|
||||
public void registerCompact(Class<?> moduleClass, String... modid) {
|
||||
for (String id : modid) {
|
||||
if (!Loader.isModLoaded(id)) {
|
||||
public void registerCompact(Class<?> moduleClass, Object... objs) {
|
||||
for(Object obj : objs){
|
||||
if(obj instanceof String){
|
||||
String modid = (String) obj;
|
||||
if(modid.startsWith("!")){
|
||||
if (Loader.isModLoaded(modid.replace("!", ""))) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Loader.isModLoaded(modid)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if(obj instanceof Boolean){
|
||||
if(!(Boolean)obj){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
compatModules.add((ICompatModule) moduleClass.newInstance());
|
||||
|
|
Loading…
Reference in a new issue