Search in sources :

Example 1 with InvalidVersionSpecificationException

use of cpw.mods.fml.common.versioning.InvalidVersionSpecificationException in project LogisticsPipes by RS485.

the class StorageDrawersInventoryHandler method init.

@Override
public boolean init() {
    List<ModContainer> modList = Loader.instance().getModList();
    for (ModContainer mod : modList) {
        if (mod.getModId().equals("StorageDrawers")) {
            try {
                VersionRange validVersions = VersionRange.createFromVersionSpec("[1.7.8,)");
                ArtifactVersion version = new DefaultArtifactVersion(mod.getVersion());
                return validVersions.containsVersion(version);
            } catch (InvalidVersionSpecificationException e) {
                return false;
            }
        }
    }
    return false;
}
Also used : ArtifactVersion(cpw.mods.fml.common.versioning.ArtifactVersion) DefaultArtifactVersion(cpw.mods.fml.common.versioning.DefaultArtifactVersion) InvalidVersionSpecificationException(cpw.mods.fml.common.versioning.InvalidVersionSpecificationException) ModContainer(cpw.mods.fml.common.ModContainer) DefaultArtifactVersion(cpw.mods.fml.common.versioning.DefaultArtifactVersion) VersionRange(cpw.mods.fml.common.versioning.VersionRange)

Aggregations

ModContainer (cpw.mods.fml.common.ModContainer)1 ArtifactVersion (cpw.mods.fml.common.versioning.ArtifactVersion)1 DefaultArtifactVersion (cpw.mods.fml.common.versioning.DefaultArtifactVersion)1 InvalidVersionSpecificationException (cpw.mods.fml.common.versioning.InvalidVersionSpecificationException)1 VersionRange (cpw.mods.fml.common.versioning.VersionRange)1