diff --git a/app/assets/js/processbuilder.js b/app/assets/js/processbuilder.js index 44bec256..54decc3c 100644 --- a/app/assets/js/processbuilder.js +++ b/app/assets/js/processbuilder.js @@ -709,6 +709,7 @@ class ProcessBuilder { * @returns {{[id: string]: string}} An object containing the paths of each library mojang declares. */ _resolveMojangLibraries(tempNativePath){ + const nativesRegex = /.+:natives-([^-]+)(?:-(.+))?/ const libs = {} const libArr = this.versionData.libraries @@ -716,27 +717,23 @@ class ProcessBuilder { for(let i=0; i -1){ + shouldExclude = true + } + }) + + const extractName = fileName.includes('/') ? fileName.substring(fileName.lastIndexOf('/')) : fileName + + // Extract the file. + if(!shouldExclude){ + fs.writeFile(path.join(tempNativePath, extractName), zipEntries[i].getData(), (err) => { + if(err){ + logger.error('Error while extracting native library:', err) + } + }) + } + + } + } + // No natives + else { + const dlInfo = lib.downloads + const artifact = dlInfo.artifact + const to = path.join(this.libPath, artifact.path) + const versionIndependentId = lib.name.substring(0, lib.name.lastIndexOf(':')) + libs[versionIndependentId] = to + } } }