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) { async launch(options) {
this.options = options; this.options = options;
this.options.root = path.resolve(this.options.root); 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: {} }; if(!this.options.overrides) this.options.overrides = { url: {} };
this.options.overrides = { if(!this.options.overrides.url) this.options.overrides.url = {};
minecraftJar: this.options.overrides.minecraftJar ? path.join(this.options.root, this.options.overrides.minecraftJar): null, this.options.overrides.url = {
versionJson: this.options.overrides.versionJson ? path.join(this.options.root, this.options.overrides.versionJson): null, meta: this.options.overrides.url.meta || "https://launchermeta.mojang.com",
directory: this.options.overrides.directory ? path.join(this.options.root, this.options.overrides.directory): null, resource: this.options.overrides.url.resource || "https://resources.download.minecraft.net",
libraries: this.options.overrides.libraries ? path.join(this.options.root, this.options.overrides.libraries): null, mavenForge: this.options.overrides.url.mavenForge || "http://files.minecraftforge.net/maven/",
natives: this.options.overrides.natives ? path.join(this.options.root, this.options.overrides.natives): null, defaultRepoForge: this.options.overrides.url.defaultRepoForge || "https://libraries.minecraft.net/"
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/"
}
}; };
this.handler = new handler(this); this.handler = new handler(this);
// Lets the events register. our magic switch! // Lets the events register. our magic switch!

View file

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