From 06337a89140ef93dc7a197f18e828536f9a82888 Mon Sep 17 00:00:00 2001 From: Pierce Date: Mon, 28 Oct 2019 18:03:32 -0400 Subject: [PATCH] v3.11.3 --- README.md | 5 +++-- components/handler.js | 3 ++- components/launcher.js | 3 ++- package.json | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b5a6448..defe28b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ##### This project is complete for now. [![Build Status](https://travis-ci.com/Pierce01/MinecraftLauncher-core.svg?branch=master)](https://travis-ci.com/Pierce01/MinecraftLauncher-core) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -![version](https://img.shields.io/badge/stable_version-3.11.2-blue) +![version](https://img.shields.io/badge/stable_version-3.11.3-blue) ![badge](https://img.shields.io/badge/ncurses-not_supported-purple) MCLC is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself. @@ -102,8 +102,9 @@ let opts = { meta: "https://launchermeta.mojang.com", // List of versions. resource: "https://resources.download.minecraft.net", // Minecraft resources. mavenForge: "http://files.minecraftforge.net/maven/", // Forge resources. - defaultRepoForge: "https://libraries.minecraft.net/" // for Forge only, you need to redefine the library url + defaultRepoForge: "https://libraries.minecraft.net/", // for Forge only, you need to redefine the library url // in the version json. + fallbackMaven: "https://search.maven.org/remotecontent?filepath=" } } } diff --git a/components/handler.js b/components/handler.js index d422d73..453021c 100644 --- a/components/handler.js +++ b/components/handler.js @@ -334,6 +334,7 @@ class Handler { const downloadLink = `${url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`; + if(fs.existsSync(path.join(jarPath, name))) { paths.push(`${jarPath}${path.sep}${name}`); counter = counter + 1; @@ -343,7 +344,7 @@ class Handler { if(!fs.existsSync(jarPath)) shelljs.mkdir('-p', jarPath); const download = await this.downloadAsync(downloadLink, jarPath, name, true, 'forge'); - if(!download) await this.downloadAsync(`https://search.maven.org/remotecontent?filepath=${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`, jarPath, name, true, 'forge'); + if(!download) await this.downloadAsync(`${this.options.overrides.url.fallbackMaven}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`, jarPath, name, true, 'forge'); paths.push(`${jarPath}${path.sep}${name}`); counter = counter + 1; diff --git a/components/launcher.js b/components/launcher.js index e1bf9c6..5c8c41e 100644 --- a/components/launcher.js +++ b/components/launcher.js @@ -20,7 +20,8 @@ class MCLCore extends EventEmitter { meta: this.options.overrides.url.meta || "https://launchermeta.mojang.com", resource: this.options.overrides.url.resource || "https://resources.download.minecraft.net", mavenForge: this.options.overrides.url.mavenForge || "http://files.minecraftforge.net/maven/", - defaultRepoForge: this.options.overrides.url.defaultRepoForge || "https://libraries.minecraft.net/" + defaultRepoForge: this.options.overrides.url.defaultRepoForge || "https://libraries.minecraft.net/", + fallbackMaven: this.options.overrides.url.fallbackMaven || "https://search.maven.org/remotecontent?filepath=" }; this.handler = new handler(this); // Lets the events register. our magic switch! diff --git a/package.json b/package.json index 4dbfa62..e86bb8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.11.2", + "version": "3.11.3", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": {