Simplified overrides. added more keywords

This commit is contained in:
Pierce 2019-08-22 11:40:38 -04:00
parent 72f6104763
commit eec04746e6
2 changed files with 12 additions and 15 deletions

View file

@ -13,20 +13,15 @@ class MCLCore extends EventEmitter {
async launch(options) {
this.options = options;
this.options.root = path.resolve(this.options.root);
// Simplified overrides so launcher devs can set the paths to what ever they want. see docs for variable names.
if(!this.options.overrides) this.options.overrides = { url: {} };
this.options.overrides = {
minecraftJar: this.options.overrides.minecraftJar ? path.join(this.options.root, this.options.overrides.minecraftJar): null,
versionJson: this.options.overrides.versionJson ? path.join(this.options.root, this.options.overrides.versionJson): null,
directory: this.options.overrides.directory ? path.join(this.options.root, this.options.overrides.directory): null,
libraries: this.options.overrides.libraries ? path.join(this.options.root, this.options.overrides.libraries): null,
natives: this.options.overrides.natives ? path.join(this.options.root, this.options.overrides.natives): null,
assetRoot: this.options.overrides.assetRoot ? path.join(this.options.root, this.options.overrides.assetRoot): null,
url: {
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/"
}
if(!this.options.overrides.url) this.options.overrides.url = {};
this.options.overrides.url = {
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/"
};
this.handler = new handler(this);
// Lets the events register. our magic switch!

View file

@ -1,6 +1,6 @@
{
"name": "minecraft-launcher-core",
"version": "3.9.0",
"version": "3.9.1",
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
"main": "index.js",
"dependencies": {
@ -21,7 +21,9 @@
"keywords": [
"minecraft",
"minecraft-launcher-node",
"minecraft-launcher"
"minecraft-launcher",
"launcher",
"minecraft-forge"
],
"author": "Pierce Harriz",
"license": "MIT",