예제 #1
0
  @Override

  /** Draws the screen and all the components in it. */
  public void drawScreen(int par1, int par2, float par3) {
    this.drawDefaultBackground();
    int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10);
    this.drawCenteredString(
        this.fontRenderer,
        "Forge Mod Loader has found a problem with your minecraft installation",
        this.width / 2,
        offset,
        0xFFFFFF);
    offset += 10;
    this.drawCenteredString(
        this.fontRenderer,
        "The mods and versions listed below could not be found",
        this.width / 2,
        offset,
        0xFFFFFF);
    offset += 5;
    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.fontRenderer,
              String.format(
                  "%s : minimum version required is %s",
                  v.getLabel(), dav.getRange().getLowerBoundString()),
              this.width / 2,
              offset,
              0xEEEEEE);
          continue;
        }
      }
      this.drawCenteredString(
          this.fontRenderer,
          String.format("%s : %s", v.getLabel(), v.getRangeString()),
          this.width / 2,
          offset,
          0xEEEEEE);
    }
    offset += 20;
    this.drawCenteredString(
        this.fontRenderer,
        "The file 'ForgeModLoader-client-0.log' contains more information",
        this.width / 2,
        offset,
        0xFFFFFF);
  }
  private void buildGraph(List<ModContainer> modList, Map<String, ModContainer> nameLookup) {
    modGraph = new DirectedGraph<ModContainer>();
    modGraph.addNode(beforeAll);
    modGraph.addNode(before);
    modGraph.addNode(afterAll);
    modGraph.addNode(after);
    modGraph.addEdge(before, after);
    modGraph.addEdge(beforeAll, before);
    modGraph.addEdge(after, afterAll);

    for (ModContainer mod : modList) {
      modGraph.addNode(mod);
    }

    for (ModContainer mod : modList) {
      if (mod.isImmutable()) {
        // Immutable mods are always before everything
        modGraph.addEdge(beforeAll, mod);
        modGraph.addEdge(mod, before);
        continue;
      }
      boolean preDepAdded = false;
      boolean postDepAdded = false;

      for (ArtifactVersion dep : mod.getDependencies()) {
        preDepAdded = true;

        String modid = dep.getLabel();
        if (modid.equals("*")) {
          // We are "after" everything
          modGraph.addEdge(mod, afterAll);
          modGraph.addEdge(after, mod);
          postDepAdded = true;
        } else {
          modGraph.addEdge(before, mod);
          if (nameLookup.containsKey(modid) || Loader.isModLoaded(modid)) {
            modGraph.addEdge(nameLookup.get(modid), mod);
          }
        }
      }

      for (ArtifactVersion dep : mod.getDependants()) {
        postDepAdded = true;

        String modid = dep.getLabel();
        if (modid.equals("*")) {
          // We are "before" everything
          modGraph.addEdge(beforeAll, mod);
          modGraph.addEdge(mod, before);
          preDepAdded = true;
        } else {
          modGraph.addEdge(mod, after);
          if (Loader.isModLoaded(modid)) {
            modGraph.addEdge(mod, nameLookup.get(modid));
          }
        }
      }

      if (!preDepAdded) {
        modGraph.addEdge(before, mod);
      }

      if (!postDepAdded) {
        modGraph.addEdge(mod, after);
      }
    }
  }