Force GC after creating mod, might fix jvm issue

This commit is contained in:
JFronny 2020-08-29 18:09:07 +02:00
parent dc523e402f
commit 0cfdf60406

View File

@ -56,7 +56,7 @@ public class PreLaunch implements PrePrePreLaunch {
}
//Generate mods
for (int i = 0; i < cfg.modsCount; i++) {
File f = new File(path, "f" + i + ".jar");
File f = new File(path, "f" + (i + 1) + ".jar");
injector.addMod(f);
//Do not load if cached
if (f.exists()) {
@ -80,9 +80,9 @@ public class PreLaunch implements PrePrePreLaunch {
sb = new StringBuilder();
sb.append("{");
sb.append("\"schemaVersion\": 1,");
sb.append("\"id\": \"modmod_").append(i).append("\",");
sb.append("\"id\": \"modmod_").append(i + 1).append("\",");
sb.append("\"version\": \"1.0\",");
sb.append("\"name\": \"ModsMod ").append(i).append("\",");
sb.append("\"name\": \"ModsMod ").append(i + 1).append("\",");
//sb.append("\"icon\": \"assets/modsmod/icon_1.png\",");
sb.append("\"entrypoints\": {},");
sb.append("\"custom\": {");
@ -99,6 +99,7 @@ public class PreLaunch implements PrePrePreLaunch {
System.err.println("Failed to generate mod!");
e.printStackTrace();
}
System.gc();
}
}
}