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.
[![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)
@ -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?
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
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) {
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: {} };
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/",
fallbackMaven: this.options.overrides.url.fallbackMaven || "https://search.maven.org/remotecontent?filepath="
this.options.overrides = {
...this.options.overrides,
url: {
meta: "https://launchermeta.mojang.com",
resource: "https://resources.download.minecraft.net",
mavenForge: "http://files.minecraftforge.net/maven/",
defaultRepoForge: "https://libraries.minecraft.net/",
fallbackMaven: "https://search.maven.org/remotecontent?filepath=",
...this.options.overrides ? this.options.overrides.url : undefined
}
};
this.handler = new handler(this);
// Lets the events register. our magic switch!
await void(0);
@ -122,7 +123,7 @@ class MCLCore extends EventEmitter {
const launchArguments = args.concat(jvm, classPaths, launchOptions);
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,
{cwd: this.options.overrides.cwd || this.options.root});

View file

@ -1,6 +1,6 @@
{
"name": "minecraft-launcher-core",
"version": "3.12.0",
"version": "3.12.1",
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
"main": "index.js",
"dependencies": {