Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCherry committed Mar 19, 2020
2 parents 10d1fb7 + 59e3a9b commit 36b9f76
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/assets/js/processbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,24 @@ class ProcessBuilder {
return mcArgs
}

/**
* Ensure that the classpath entries all point to jar files.
*
* @param {Array.<String>} list Array of classpath entries.
*/
_processClassPathList(list) {

const ext = '.jar'
const extLen = ext.length
for (let i = 0; i < list.length; i++) {
const extIndex = list[i].indexOf(ext)
if (extIndex > -1 && extIndex !== list[i].length - extLen) {
list[i] = list[i].substring(0, extIndex + extLen)
}
}

}

/**
* Resolve the full classpath argument list for this process. This method will resolve all Mojang-declared
* libraries as well as the libraries declared by the server. Since mods are permitted to declare libraries,
Expand Down Expand Up @@ -624,6 +642,8 @@ class ProcessBuilder {
const finalLibs = {...mojangLibs, ...servLibs}
cpArgs = cpArgs.concat(Object.values(finalLibs))

this._processClassPathList(cpArgs)

return cpArgs
}

Expand Down

0 comments on commit 36b9f76

Please sign in to comment.