diff --git a/DecompileMinecraft.js b/DecompileMinecraft.js index f52b73b..acdf9b2 100644 --- a/DecompileMinecraft.js +++ b/DecompileMinecraft.js @@ -16,10 +16,17 @@ function unlink(path) { } catch (e) {} } +function unlinkRecursive(path) { + try { + fs.rmdirSync(path, {recursive: true} ) + return true + } catch (e) { console.log(e) } +} async function re() { + unlinkRecursive(modBuilding) mkdir(modBuilding) - await require("./Exec.js").exec(`java -Xmx4G -Xms1G -jar lib\\FernFlower.jar -hes=1 -hdc=1 -dgs=1 -ren=0 -lit=0 -nns=0 -asc=1 -rbr=1 ./data/${ver}-Mapped.jar ${modBuilding}`) + await require("./Exec.js").exec(`java -Xmx4G -Xms1G -jar lib\\FernFlower.jar -hes=1 -hdc=1 -dgs=1 -ren=0 -lit=0 -nns=0 -asc=1 -rbr=1 -log=WARN ./data/${ver}-Mapped.jar ${modBuilding}`) let sources = `${modBuilding}/${ver}-Mapped.jar` await fs.createReadStream(sources).pipe(unzip.Extract({ path: modBuilding })).promise() diff --git a/MapMinecraft.js b/MapMinecraft.js index abf57c1..f420b6f 100644 --- a/MapMinecraft.js +++ b/MapMinecraft.js @@ -1,2 +1,2 @@ let ver = require("./config.json").version -require("./Exec.js").exec(`java -jar lib\\SpecialSource.jar -srg-in=.\\data\\${ver}.txt --in-jar=.\\data\\${ver}.jar -o=.\\data\\${ver}-Mapped.jar`) \ No newline at end of file +require("./Exec.js").exec(`java -jar lib\\SpecialSource.jar -srg-in=.\\data\\${ver}.txt --kill-lvt --in-jar=.\\data\\${ver}.jar -o=.\\data\\${ver}-Mapped.jar`) \ No newline at end of file