diff --git a/app/assets/js/processbuilder.js b/app/assets/js/processbuilder.js index 0f1ef8dd..173501a4 100644 --- a/app/assets/js/processbuilder.js +++ b/app/assets/js/processbuilder.js @@ -569,6 +569,24 @@ class ProcessBuilder { return mcArgs } + /** + * Ensure that the classpath entries all point to jar files. + * + * @param {Array.} list Array of classpath entries. + */ + _processClassPathList(list) { + + const ext = '.jar' + const extLen = ext.length + for(let i=0; i -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, @@ -601,6 +619,8 @@ class ProcessBuilder { const finalLibs = {...mojangLibs, ...servLibs} cpArgs = cpArgs.concat(Object.values(finalLibs)) + this._processClassPathList(cpArgs) + return cpArgs } @@ -733,6 +753,7 @@ class ProcessBuilder { } return libs } + } module.exports = ProcessBuilder \ No newline at end of file