#!/bin/node var fs = require('fs'); var path = require('path'); var profilesPath = path.join(process.env.HOME, '/.minecraft/launcher_profiles.json'); var profiles = require(profilesPath); var def = "-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"; var patch = " -Dorg.lwjgl.librarypath=\"/home/loek/.minecraft\"" for (var profile in profiles.profiles) { var javaArgs = profiles.profiles[profile].javaArgs profiles.profiles[profile].javaArgs = javaArgs ? (javaArgs.includes(patch) ? javaArgs : javaArgs + patch) : (def + patch); } fs.writeFileSync(profilesPath, JSON.stringify(profiles, null, 4))