Package cpw.mods.fml.common.versioning

Examples of cpw.mods.fml.common.versioning.ArtifactVersion


      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(']');
View Full Code Here


    if (index < 0) {
      if (!lowerBoundInclusive | !upperBoundInclusive) {
        throw new InvalidVersionSpecificationException("Single version must be surrounded by []: " + spec);
      }

      ArtifactVersion version = getArtifactVersion(label, process);

      restriction = new Restriction(version, lowerBoundInclusive, version, upperBoundInclusive);
    } else {
      String lowerBound = process.substring(0, index).trim();
      String upperBound = process.substring(index + 1).trim();
      if (lowerBound.equals(upperBound)) {
        throw new InvalidVersionSpecificationException("Range cannot have identical boundaries: " + spec);
      }

      ArtifactVersion lowerVersion = null;
      if (lowerBound.length() > 0) {
        lowerVersion = getArtifactVersion(label, lowerBound);
      }
      ArtifactVersion upperVersion = null;
      if (upperBound.length() > 0) {
        upperVersion = getArtifactVersion(label, upperBound);
      }

      if (upperVersion != null & lowerVersion != null && upperVersion.compareTo(lowerVersion) < 0) {
        throw new InvalidVersionSpecificationException("Range defies version ordering: " + spec);
      }

      restriction = new Restriction(lowerVersion, lowerBoundInclusive, upperVersion, upperBoundInclusive);
    }
View Full Code Here

                    //String homepage = (String)json.get("homepage");
                    Map<String, String> promos = (Map<String, String>)json.get("promos");

                    String rec = promos.get(MinecraftForge.MC_VERSION + "-recommended");
                    String lat = promos.get(MinecraftForge.MC_VERSION + "-latest");
                    ArtifactVersion current = new DefaultArtifactVersion(getVersion());

                    if (rec != null)
                    {
                        ArtifactVersion recommended = new DefaultArtifactVersion(rec);
                        int diff = recommended.compareTo(current);

                        if (diff == 0)
                            status = UP_TO_DATE;
                        else if (diff < 0)
                        {
View Full Code Here

    if (!isModLoaded(modname))
      return false;

    if (versionRangeString != null) {
      ModContainer mod = Loader.instance().getIndexedModList().get(modname);
      ArtifactVersion modVersion = mod.getProcessedVersion();

      VersionRange versionRange = VersionParser.parseRange(versionRangeString);
      DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(modname, versionRange);

      if (!requiredVersion.containsVersion(modVersion))
View Full Code Here

              boolean loaded = ModStatusHelper.isModLoaded(modId);
              if(loaded && !version.equals("")) {
                ModContainer mod = Loader.instance().getIndexedModList().get(modId);
                if(mod != null) {
                  VersionRange range = VersionParser.parseRange(version);
                  ArtifactVersion artifactVersion = new DefaultArtifactVersion("Version", mod.getVersion());
                  loaded = range.containsVersion(artifactVersion);
                } else {
                  loaded = false;
                }
              }
View Full Code Here

                    }
                }
            }
            if (apiContainers.containsKey(container.ownerMod.getLabel()))
            {
                ArtifactVersion owner = container.ownerMod;
                do
                {
                    APIContainer parent = apiContainers.get(owner.getLabel());
                    if (parent == container)
                    {
                        FMLLog.finer("APIContainer %s is it's own parent. skipping", owner);
                        container.markSelfReferenced();
                        break;
                    }
                    FMLLog.finer("Removing upstream parent %s from %s", parent.ownerMod.getLabel(), container);
                    container.currentReferents.remove(parent.ownerMod.getLabel());
                    container.referredMods.remove(parent.ownerMod);
                    owner = parent.ownerMod;
                }
                while (apiContainers.containsKey(owner.getLabel()));
            }
            FMLLog.fine("Creating API container dummy for API %s: owner: %s, dependents: %s", container.providedAPI, container.ownerMod, container.referredMods);
        }
    }
View Full Code Here

TOP

Related Classes of cpw.mods.fml.common.versioning.ArtifactVersion

Copyright © 2018 www.massapicom. 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.