Skip to content

Commit

Permalink
Added Profile stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TalonFloof committed Jul 28, 2023
1 parent ddc5dbb commit 8a093b3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ class MainFrame : JFrame() {
}
try {
val pb = if(os.contains("win"))
ProcessBuilder("cmd.exe","/C",tempDir.resolve("gradlew.bat").absolutePath+" build")
ProcessBuilder("cmd.exe","/C",tempDir.resolve("gradlew.bat").absolutePath+" decompile")
else
ProcessBuilder("bash","-c",tempDir.resolve("gradlew").absolutePath+" build")
ProcessBuilder("bash","-c",tempDir.resolve("gradlew").absolutePath+" decompile")
pb.directory(tempDir)
pb.redirectOutput(File("out.log"))
pb.redirectError(File("err.log"))
Expand Down Expand Up @@ -220,6 +220,16 @@ class MainFrame : JFrame() {
JOptionPane.YES_NO_OPTION
) == JOptionPane.YES_OPTION
) {
jsonObj = Gson().fromJson(File(minecraftPath).resolve("launcher_profiles.json").readText(), JsonObject::class.java)
var profile = JsonObject()
profile.add("created",JsonPrimitive("1970-01-02T00:00:00.000Z"))
profile.add("lastUsed",JsonPrimitive("1970-01-02T00:00:00.000Z"))
profile.add("lastVersionId",JsonPrimitive(minecraftVersionBox.text+"-vulpes"))
profile.add("name",JsonPrimitive("Vulpes ("+minecraftVersionBox.text+")"))
profile.add("type",JsonPrimitive("custom"))
profile.add("icon",JsonPrimitive("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAPj0lEQVR4nOyde5AcxX3HWyfxEI/MKiaYgMksViApqHjGdgJ+kPSqoEgcqjIb4tiF7WSW4KQIMZ4TSRXBecxVJZRjUpU5YmwHJ3bvObapCDuzODghGLtneTmAcc85kWMUUM8S8ZKQeha9kE5Su/rYE6e73bvdnZ7u3bv9/Kc7Xf9+v++3t7dnpqd7HViBQAjPKhaLlxSLxYts235roVD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t/PmAnll3V22g0ZiYnJ/+4S/2UTZTyolqtrogt7oRnwjspjbUOQ7hvuV7X7iHRsGEYxli3I96g0nbJVwe6WtffbDZBpVL5WGsS0xExqek28KDSbDaP1Wq1v9WdRwb2t7ySTxiG40v1PN/3+16oMEi05j1drY4aNMIw3JybMK3hsePqVN/3b8gtuGJEZ1ZrXXYYYw8Jj3IVpnUuTttFiWEY3pZrcIW05j09LZXXTFN4o0ScIAg+3C4DjPFXlCSgCAjh+cNyHqDwRKk4hJC7FiaxEncLC4Lgg3os7R5CiPojakzTPLXNieP7VuIbw4N8Ujhj7EnTNE/RIgyE8C2c8xfnJ+Q4zs9pSSZHWsuxHtRnc0deFB5oFcd13Us55/vnMvJ9/zqtCeWEZVkGYyzzppoS2T8wR/AGQeDMbW8yt/HASsSyrDczxv5Xt/Oc8yNBEJR163ECCKGPtp5wPTcoK2rywLKscxhj/63R/GMIoet169AWhNDsncKVvneQZVlvYow9qsP9tm/2DhIIoZvDMLxddx55I66CCCFbFJt/s+66uwIh9H7TNNfpziNvxFddGIa3KjgL4ChC6Ebd9fbESp4HLMTzvE2c8xdyMv8QQuhDumscsQyWZZ1FCLlHsvnM87wrddc2okvEqOf7/gcX3hzry3nGtrXdyWPE4GNZ1gaM8Wf63fqVUvoNy7Jkrg4eoQPXdd/W4/Gxh8MwvMUwjCWX648YMnzfv5Ix9vhyQ77neZfqznVETrTmB1cxxh5Z4P0RjPGkaZqn6c5xhCJc1303pXQLY+wpz/PepTOXHwcAAP//ET+GGobva3IAAAAASUVORK5CYII="))
jsonObj.getAsJsonObject("profiles").add(minecraftVersionBox.text+"-vulpes",profile)
File(minecraftPath).resolve("launcher_profiles.json").writeText(Gson().toJson(jsonObj))
JOptionPane.showMessageDialog(
this,
"Profile was successfully created\nIf the Minecraft Launcher is currently running then you'll need to restart it to see the new profile",
Expand Down

0 comments on commit 8a093b3

Please sign in to comment.