Java 类cpw.mods.fml.common.versioning.VersionRange 实例源码

项目:ThermalRecycling    文件:ModPlugin.java   
public boolean isAcceptibleVersion(final String version) {
    try {
        final VersionRange range = VersionRange.createFromVersionSpec(version);
        return range.containsVersion(this.mod.getArtifactVersion());
    } catch (InvalidVersionSpecificationException e) {
        e.printStackTrace();
        return false;
    }
}
项目:NEI-Integration    文件:Utils.java   
public static boolean isModLoaded(String modid, String versionRangeString) {
    if (!isModLoaded(modid)) {
        return false;
    }

    ModContainer mod = Loader.instance().getIndexedModList().get(modid);
    VersionRange versionRange = VersionParser.parseRange(versionRangeString);
    DefaultArtifactVersion required = new DefaultArtifactVersion(modid, versionRange);

    return required.containsVersion(mod.getProcessedVersion());
}
项目:4Space-5    文件:MicdoodleModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return VersionParser.parseRange(MicdoodlePlugin.mcVersion);
}
项目:4Space-5    文件:NEIModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange() {
    return VersionParser.parseRange(CodeChickenCorePlugin.mcVersion);
}
项目:4Space-5    文件:CodeChickenCoreModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange() {
    return VersionParser.parseRange(CodeChickenCorePlugin.mcVersion);
}
项目:TRHS_Club_Mod_2016    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:TRHS_Club_Mod_2016    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:TRHS_Club_Mod_2016    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:TRHS_Club_Mod_2016    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:ThermosRebased    文件:FanDefaultModContainer.java   
public VersionRange acceptableMinecraftVersionRange() {
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:ThermosRebased    文件:ModContainerWrapper.java   
public VersionRange acceptableMinecraftVersionRange() {
    return this.mContainer.acceptableMinecraftVersionRange();
}
项目:CauldronGit    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:CauldronGit    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:CauldronGit    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:CauldronGit    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:AMCore    文件:ModRange.java   
public static VersionRange createFromVersionSpec(String label, String spec) throws InvalidVersionSpecificationException {

        if (spec == null) {
            return null;
        }

        List<Restriction> restrictions = new ArrayList<Restriction>();
        String process = spec;
        ArtifactVersion version = null;
        ArtifactVersion upperBound = null;
        ArtifactVersion lowerBound = null;

        while (process.startsWith("[") || process.startsWith("(")) {

            int index1 = process.indexOf(')');
            int index2 = process.indexOf(']');

            int index = index2;
            if (((index2 < 0) | index1 < index2) & index1 >= 0) {
                index = index1;
            }

            if (index < 0) {
                throw new InvalidVersionSpecificationException("Unbounded range: " + spec);
            }

            Restriction restriction = parseRestriction(label, process.substring(0, index + 1));
            if (lowerBound == null) {
                lowerBound = restriction.getLowerBound();
            }
            if (upperBound != null) {
                if (restriction.getLowerBound() == null || restriction.getLowerBound().compareTo(upperBound) < 0) {
                    throw new InvalidVersionSpecificationException("Ranges overlap: " + spec);
                }
            }
            restrictions.add(restriction);
            upperBound = restriction.getUpperBound();

            process = process.substring(index + 1).trim();

            if (process.length() > 0 && process.startsWith(",")) {
                process = process.substring(1).trim();
            }
        }

        if (process.length() > 0) {
            if (restrictions.size() > 0) {
                throw new InvalidVersionSpecificationException("Only fully-qualified sets allowed in multiple set scenario: " + spec);
            } else {
                version = getArtifactVersion(label, process);
                restrictions.add(Restriction.EVERYTHING);
            }
        }

        try {
            return VersionRange.newRange(version, restrictions);
        } catch (Throwable e) {
            e.printStackTrace();
        }
        return null;
    }
项目:TechnicBlocks    文件:TechnicBlockModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange() {
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:Cauldron    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:Cauldron    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:Cauldron    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:Cauldron    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:Cauldron    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:Cauldron    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:Cauldron    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:Cauldron    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:Cauldron    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:Cauldron    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:Cauldron    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:Cauldron    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:Atmatm6_Mods    文件:MicdoodleModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return VersionParser.parseRange(MicdoodlePlugin.mcVersion);
}
项目:RuneCraftery    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:RuneCraftery    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:RuneCraftery    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:RuneCraftery    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:RuneCraftery    文件:ModLoaderModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:RuneCraftery    文件:InjectedModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return wrappedContainer.acceptableMinecraftVersionRange();
}
项目:RuneCraftery    文件:MinecraftDummyContainer.java   
public VersionRange getStaticVersionRange()
{
    return staticRange;
}
项目:RuneCraftery    文件:DummyModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}
项目:RuneCraftery    文件:FMLModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return minecraftAccepted;
}
项目:RuneCraftery    文件:ModLoaderModContainer.java   
@Override
public VersionRange acceptableMinecraftVersionRange()
{
    return Loader.instance().getMinecraftModContainer().getStaticVersionRange();
}