Package logisticspipes.utils

Source Code of logisticspipes.utils.ModStatusHelper

package logisticspipes.utils;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;

public class ModStatusHelper {
  public static boolean isModLoaded(String modId) {
    if(modId.contains("@")) {
      String version = modId.substring(modId.indexOf('@') + 1);
      modId = modId.substring(0, modId.indexOf('@'));
      if(Loader.isModLoaded(modId)) {
        ModContainer mod = Loader.instance().getIndexedModList().get(modId);
        if(mod != null) {
          return mod.getVersion().startsWith(version);
        }
      }
      return false;
    } else {
      return Loader.isModLoaded(modId);
    }
  }
}
TOP

Related Classes of logisticspipes.utils.ModStatusHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.