Skip to content

launcher cant download .JAR for custom version #88

@arduinka55055

Description

@arduinka55055

it happens because custom versions use inheritsFrom, so need to read original version and merge with custom.

My solution that works:
change handler.js, line 106, getVersion:

return new Promise(resolve => {
  const versionJsonPath = this.options.overrides.versionJson ||
      path.join(this.options.directory, `${this.options.version.number}.json`)
  if (fs.existsSync(versionJsonPath)) {
      let version = JSON.parse(fs.readFileSync(versionJsonPath))

      if (version.inheritsFrom != null) {//my solution

          this.options.overrides.versionJson = undefined;
          this.getVersion(version.inheritsFrom).then((parentt) => {
              this.version = {...version, ...parentt };
              return resolve(this.version);
          });

      } else {
              this.version = version;
              return resolve(version);
      }
  }

also need to set this.options.overrides.versionJson to custom version instead original version number, tho it is possible to do in configs.

that will make library launch forge and fabric without any problems!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions