Skip to content

Commit

Permalink
finish 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 committed Oct 29, 2023
1 parent 9f4dcf5 commit cb9b205
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ public void save() {
*/
public void reloadFromDisk() {
try {
String json = Files.readString(this.configPath);
System.out.println(json);
System.out.println(JANKSON.load(json));
this.config = JANKSON.fromJson(json, this.configClass);
JsonObject json = JANKSON.load(Files.readAllLines(this.configPath).stream().reduce((a, b) -> a + "\n" + b).orElse(""));
this.config = JANKSON.fromJsonCarefully(json, this.configClass);
} catch (Exception e) {
JamLib.LOGGER.error("Failed to read config file at " + configPath, e);
JamLib.LOGGER.error("Resetting to defaults; a backup will be written to " + configPath + ".broken");
Expand Down

0 comments on commit cb9b205

Please sign in to comment.