Package cpw.mods.fml.common.versioning

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


        this.setMaxStackSize(1);
        this.setMaxDamage(100);
        this.setNoRepair();
        this.setMaxTransfer();

        this.mcVersion = new DefaultArtifactVersion((String) FMLInjectionData.data()[4]);

        if (EnergyConfigHandler.isIndustrialCraft2Loaded())
        {
            if (VersionParser.parseRange("[1.7.2]").containsVersion(mcVersion))
            {
View Full Code Here


        }
    }

    public static void versionCheck(String reqVersion, String mod) {
        String mcVersion = (String) FMLInjectionData.data()[4];
        if (!VersionParser.parseRange(reqVersion).containsVersion(new DefaultArtifactVersion(mcVersion))) {
            String err = "This version of " + mod + " does not support minecraft version " + mcVersion;
            logger.error(err);

            JEditorPane ep = new JEditorPane("text/html",
                    "<html>" +
View Full Code Here

  }

  public static void versionCheck(String reqVersion, String mod) {

    String mcVersion = (String) FMLInjectionData.data()[4];
    if (!VersionParser.parseRange(reqVersion).containsVersion(new DefaultArtifactVersion(mcVersion))) {
      String err = "This version of " + mod + " does not support Minecraft version " + mcVersion;
      System.err.println(err);

      JEditorPane ep = new JEditorPane("text/html", "<html>" + err
          + "<br>Remove it from your coremods folder and check <a href=\"http://teamcofh.com/\">here</a> for updates" + "</html>");
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)
                        {
                            status = AHEAD;
                            if (lat != null)
                            {
                                if (current.compareTo(new DefaultArtifactVersion(lat)) < 0)
                                {
                                    status = OUTDATED;
                                    target = lat;
                                }
                            }
                        }
                        else
                        {
                            status = OUTDATED;
                            target = rec;
                        }
                    }
                    else if (lat != null)
                    {
                        if (current.compareTo(new DefaultArtifactVersion(lat)) < 0)
                        {
                            status = BETA_OUTDATED;
                            target = lat;
                        }
                        else
View Full Code Here

        }

        if (recommendedVersion == null)
          return;

        int result = FMLCommonHandler.instance().findContainerFor(Forestry.instance).getProcessedVersion().compareTo(new DefaultArtifactVersion(recommendedVersion));
        if (result >= 0) {
          Proxies.log.finer("Using the latest version [" + VERSION + " (build:" + BUILD_NUMBER + ")] for Minecraft " + mcVersion);
          currentVersion = EnumUpdateState.CURRENT;
          return;
        }
View Full Code Here

    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))
        return false;
    }

    return true;
  }
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

    @Override
    public ArtifactVersion getProcessedVersion()
    {
        if (processedVersion == null)
        {
            processedVersion = new DefaultArtifactVersion(getModId(), getVersion());
        }
        return processedVersion;
    }
View Full Code Here

        for (ArtifactVersion v : modsMissing.missingMods)
        {
            offset+=10;
            if (v instanceof DefaultArtifactVersion)
            {
                DefaultArtifactVersion dav =  (DefaultArtifactVersion)v;
                if (dav.getRange() != null && dav.getRange().isUnboundedAbove())
                {
                    this.drawCenteredString(this.fontRendererObj, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.width / 2, offset, 0xEEEEEE);
                    continue;
                }
            }
            this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE);
        }
View Full Code Here

        public APIContainer(String providedAPI, String apiVersion, File source, ArtifactVersion ownerMod)
        {
            this.providedAPI = providedAPI;
            this.version = apiVersion;
            this.ownerMod = ownerMod;
            this.ourVersion = new DefaultArtifactVersion(providedAPI, apiVersion);
            this.referredMods = Lists.newArrayList();
            this.source = source;
            this.currentReferents = Sets.newHashSet();
            this.packages = Sets.newHashSet();
        }
View Full Code Here

TOP

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

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.