Fixed images, slight refactor

This commit is contained in:
Pierce 2020-03-17 20:15:32 -04:00
parent 2f65a98d9a
commit cc9396a851
3 changed files with 15 additions and 14 deletions

View file

@ -1,4 +1,4 @@
![logo](https://pierce.is-serious.business/8mT5kxc.png) ![logo](https://owo.whats-th.is/8mT5kxc.png)
##### This project is complete for now. ##### 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) [![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) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@ -182,7 +182,7 @@ You'll need to provide the folder created in the versions if you're running the
#### What should it look like running from console? #### What should it look like running from console?
The `pid` is printed in console after the process is launched. The `pid` is printed in console after the process is launched.
![gif](https://pierce.is-serious.business/3N3PMC4.gif) ![gif](https://owo.whats-th.is/8mT5kxc.png/3N3PMC4.gif)
## Contributors ## Contributors
These are the people that helped out that aren't listed [here](https://github.com/Pierce01/MinecraftLauncher-core/graphs/contributors)! These are the people that helped out that aren't listed [here](https://github.com/Pierce01/MinecraftLauncher-core/graphs/contributors)!

View file

@ -12,17 +12,18 @@ 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);
this.options.overrides = {
// Simplified overrides so launcher devs can set the paths to what ever they want. see docs for variable names. ...this.options.overrides,
if(!this.options.overrides) this.options.overrides = { url: {} }; url: {
if(!this.options.overrides.url) this.options.overrides.url = {}; meta: "https://launchermeta.mojang.com",
this.options.overrides.url = { resource: "https://resources.download.minecraft.net",
meta: this.options.overrides.url.meta || "https://launchermeta.mojang.com", mavenForge: "http://files.minecraftforge.net/maven/",
resource: this.options.overrides.url.resource || "https://resources.download.minecraft.net", defaultRepoForge: "https://libraries.minecraft.net/",
mavenForge: this.options.overrides.url.mavenForge || "http://files.minecraftforge.net/maven/", fallbackMaven: "https://search.maven.org/remotecontent?filepath=",
defaultRepoForge: this.options.overrides.url.defaultRepoForge || "https://libraries.minecraft.net/", ...this.options.overrides ? this.options.overrides.url : undefined
fallbackMaven: this.options.overrides.url.fallbackMaven || "https://search.maven.org/remotecontent?filepath=" }
}; };
this.handler = new handler(this); this.handler = new handler(this);
// Lets the events register. our magic switch! // Lets the events register. our magic switch!
await void(0); await void(0);
@ -122,7 +123,7 @@ class MCLCore extends EventEmitter {
const launchArguments = args.concat(jvm, classPaths, launchOptions); const launchArguments = args.concat(jvm, classPaths, launchOptions);
this.emit('arguments', launchArguments); this.emit('arguments', launchArguments);
this.emit('debug', launchArguments.join(' ')); this.emit('debug', `[MCLC]: Launching with arguments ${launchArguments.join(' ')}`);
const minecraft = child.spawn(this.options.javaPath ? this.options.javaPath : 'java', launchArguments, const minecraft = child.spawn(this.options.javaPath ? this.options.javaPath : 'java', launchArguments,
{cwd: this.options.overrides.cwd || this.options.root}); {cwd: this.options.overrides.cwd || this.options.root});

View file

@ -1,6 +1,6 @@
{ {
"name": "minecraft-launcher-core", "name": "minecraft-launcher-core",
"version": "3.12.0", "version": "3.12.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": {