Launcher: fix natives MC 26.x (sous-dossiers java/jna/lwjgl/netty, extraction vers java/)
This commit is contained in:
@@ -719,6 +719,12 @@ class ProcessBuilder {
|
|||||||
|
|
||||||
const libArr = this.vanillaManifest.libraries
|
const libArr = this.vanillaManifest.libraries
|
||||||
fs.ensureDirSync(tempNativePath)
|
fs.ensureDirSync(tempNativePath)
|
||||||
|
// Mojang (1.20.5+) attend des sous-dossiers : ${natives_directory}/java (java.library.path),
|
||||||
|
// /jna, /lwjgl, /netty (extraction runtime). Sans eux -> "not a directory" -> crash LWJGL.
|
||||||
|
// (SurviePote : correctif layout natives MC 26.x, Helios 2.x extrayait à plat.)
|
||||||
|
for(const sub of ['java', 'jna', 'lwjgl', 'netty']){
|
||||||
|
fs.ensureDirSync(path.join(tempNativePath, sub))
|
||||||
|
}
|
||||||
for(let i=0; i<libArr.length; i++){
|
for(let i=0; i<libArr.length; i++){
|
||||||
const lib = libArr[i]
|
const lib = libArr[i]
|
||||||
if(isLibraryCompatible(lib.rules, lib.natives)){
|
if(isLibraryCompatible(lib.rules, lib.natives)){
|
||||||
@@ -799,13 +805,16 @@ class ProcessBuilder {
|
|||||||
|
|
||||||
const extractName = fileName.includes('/') ? fileName.substring(fileName.lastIndexOf('/')) : fileName
|
const extractName = fileName.includes('/') ? fileName.substring(fileName.lastIndexOf('/')) : fileName
|
||||||
|
|
||||||
// Extract the file.
|
// Extract the file (racine pour compat + sous-dossier java/ exigé par MC récent).
|
||||||
if(!shouldExclude){
|
if(!shouldExclude){
|
||||||
fs.writeFile(path.join(tempNativePath, extractName), zipEntries[i].getData(), (err) => {
|
const data = zipEntries[i].getData()
|
||||||
if(err){
|
for(const dest of [path.join(tempNativePath, extractName), path.join(tempNativePath, 'java', extractName)]){
|
||||||
logger.error('Error while extracting native library:', err)
|
fs.writeFile(dest, data, (err) => {
|
||||||
}
|
if(err){
|
||||||
})
|
logger.error('Error while extracting native library:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user