mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-22 12:16:21 +03:00
Fix duplicate launch arguments causing a crash in older versions
This commit is contained in:
parent
3036b1de6d
commit
2ca80ba612
1 changed files with 7 additions and 1 deletions
|
@ -62,7 +62,13 @@ module.exports = async function (options) {
|
|||
|
||||
const launchArguments = args.concat(jvm, classPaths, launchOptions);
|
||||
|
||||
const minecraft = child.spawn(options.javaPath ? options.javaPath : 'java', launchArguments);
|
||||
const cleanArguments = [];
|
||||
for(arg in launchArguments) {
|
||||
if (cleanArguments.includes(launchArguments[arg])) continue;
|
||||
cleanArguments.push(launchArguments[arg]);
|
||||
}
|
||||
|
||||
const minecraft = child.spawn(options.javaPath ? options.javaPath : 'java', cleanArguments);
|
||||
minecraft.stdout.on('data', (data) => event.emit('data', data));
|
||||
minecraft.stderr.on('data', (data) => event.emit('error', data));
|
||||
minecraft.on('close', (code) => event.emit('close', code));
|
||||
|
|
Loading…
Add table
Reference in a new issue