update:同步DeEarth分支
This commit is contained in:
@@ -56,6 +56,24 @@ export async function DeEarth(modpath: string, movepath: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) { //mods.toml或fabric.mod.json判断
|
} catch (error) { //mods.toml或fabric.mod.json判断
|
||||||
|
try{//DeEarthPublic
|
||||||
|
for (let i = 0; i < zip.length; i++) {
|
||||||
|
const e = zip[i]
|
||||||
|
if (e.entryName == "META-INF/mods.toml") { //Forge,Neoforge
|
||||||
|
const modid = toml.parse(e.getData().toString('utf-8')).mods[0].modId
|
||||||
|
const body = JSON.parse(await FastGot(`https://dearth.0771010.xyz/api/modid?modid=${modid}`))
|
||||||
|
if (body.isClient) {
|
||||||
|
fs.renameSync(modpath, `${movepath}/${path.basename(modpath)}`)
|
||||||
|
}
|
||||||
|
} else if (e.entryName == "fabric.mod.json") { //Fabric
|
||||||
|
const modid = JSON.parse(e.getData().toString('utf-8')).id
|
||||||
|
const body = JSON.parse(await FastGot(`https://dearth.0771010.xyz/api/modid?modid=${modid}`))
|
||||||
|
if (body.isClient) {
|
||||||
|
fs.renameSync(modpath, `${movepath}/${path.basename(modpath)}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(errorr){
|
||||||
for (let i = 0; i < zip.length; i++) {
|
for (let i = 0; i < zip.length; i++) {
|
||||||
const e = zip[i]
|
const e = zip[i]
|
||||||
try {
|
try {
|
||||||
@@ -101,7 +119,7 @@ export async function DeEarth(modpath: string, movepath: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function FastGot(url: string) {
|
async function FastGot(url: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user