mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-22 04:06:21 +03:00
Fix clean up, remove options.forge.path
This commit is contained in:
parent
c62a3b293f
commit
fafd82856f
3 changed files with 12 additions and 12 deletions
|
@ -261,7 +261,7 @@ class Handler {
|
|||
await this.downloadAsync(url, jarPath, name);
|
||||
}
|
||||
}
|
||||
libs.push(`${jarPath}/${name}`);
|
||||
libs.push(`${jarPath}${path.sep}${name}`);
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -290,14 +290,15 @@ class Handler {
|
|||
}
|
||||
|
||||
static cleanUp(array) {
|
||||
const newArray = [];
|
||||
return new Promise(resolve => {
|
||||
const newArray = [];
|
||||
|
||||
for(let argument in array) {
|
||||
if(newArray.includes(array[argument])) continue;
|
||||
newArray.push(array[argument]);
|
||||
}
|
||||
|
||||
return newArray;
|
||||
for(let classPath in array) {
|
||||
if(newArray.includes(array[classPath])) continue;
|
||||
newArray.push(array[classPath]);
|
||||
}
|
||||
resolve(newArray);
|
||||
})
|
||||
}
|
||||
|
||||
getLaunchOptions(modification) {
|
||||
|
|
|
@ -65,20 +65,19 @@ class MCLCore extends EventEmitter {
|
|||
jvm.push(await this.handler.getJVM());
|
||||
if(this.options.customArgs) jvm = jvm.concat(this.options.customArgs);
|
||||
|
||||
const classes = await this.handler.getClasses();
|
||||
const classes = await handler.cleanUp(await this.handler.getClasses());
|
||||
let classPaths = ['-cp'];
|
||||
const separator = this.handler.getOS() === "windows" ? ";" : ":";
|
||||
this.emit('debug', `[MCLC]: Using ${separator} to separate class paths`);
|
||||
if(forge) {
|
||||
this.emit('debug', '[MCLC]: Setting Forge class paths');
|
||||
classPaths.push(`${this.options.forge.path || this.options.forge}${separator}${forge.paths.join(separator)}${separator}${classes.join(separator)}${separator}${mcPath}`);
|
||||
classPaths.push(`${path.resolve(this.options.forge)}${separator}${forge.paths.join(separator)}${separator}${classes.join(separator)}${separator}${mcPath}`);
|
||||
classPaths.push(forge.forge.mainClass)
|
||||
} else {
|
||||
const file = custom || versionFile;
|
||||
classPaths.push(`${mcPath}${separator}${classes.join(separator)}`);
|
||||
classPaths.push(file.mainClass);
|
||||
}
|
||||
classPaths = await handler.cleanUp(classPaths);
|
||||
|
||||
// Download version's assets
|
||||
this.emit('debug', '[MCLC]: Attempting to download assets');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "minecraft-launcher-core",
|
||||
"version": "3.5.2",
|
||||
"version": "3.5.3",
|
||||
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Add table
Reference in a new issue