@@ -116,7 +116,7 @@ private ConfigHolder() {
116116 AuthlibInjectorServerList ::createDefault );
117117
118118 /// The loaded per-workspace config instance.
119- private static @ UnknownNullability Config configInstance ;
119+ private static @ UnknownNullability LauncherSettings configInstance ;
120120
121121 /// The loaded user-global config instance.
122122 private static @ UnknownNullability GlobalConfig globalConfigInstance ;
@@ -168,7 +168,7 @@ private ConfigHolder() {
168168 private static @ Nullable AccountStorages migratedGameAccounts ;
169169
170170 /// Returns the loaded per-workspace config.
171- public static Config config () {
171+ public static LauncherSettings config () {
172172 if (configInstance == null ) {
173173 throw new IllegalStateException ("Configuration hasn't been loaded" );
174174 }
@@ -369,7 +369,7 @@ public static void init() throws IOException {
369369 throw new IllegalStateException ("Configuration is already loaded" );
370370 }
371371
372- LOG .info ("Config location: " + SETTINGS_LOCATION );
372+ LOG .info ("Launcher settings location: " + SETTINGS_LOCATION );
373373
374374 configInstance = loadConfig ();
375375 if (!unsupportedVersion ) {
@@ -405,7 +405,7 @@ public static void init() throws IOException {
405405 }
406406
407407 /// Loads the current per-workspace config or migrates a legacy config when needed.
408- private static Config loadConfig () throws IOException {
408+ private static LauncherSettings loadConfig () throws IOException {
409409 if (Files .exists (SETTINGS_LOCATION )) {
410410 checkOwner (SETTINGS_LOCATION );
411411
@@ -415,21 +415,21 @@ private static Config loadConfig() throws IOException {
415415 } catch (Exception e ) {
416416 needBackupSettings = true ;
417417 LOG .warning ("Failed to read settings file: " + SETTINGS_LOCATION , e );
418- return new Config ();
418+ return new LauncherSettings ();
419419 }
420420
421421 if (jsonObject == null ) {
422422 LOG .warning ("Settings file is empty: " + SETTINGS_LOCATION );
423- return new Config ();
423+ return new LauncherSettings ();
424424 }
425425
426426 JsonSchemaPolicy .Result schema =
427- JsonSchemaPolicy .check (SETTINGS_LOCATION , "settings file" , jsonObject , Config .CURRENT_SCHEMA );
427+ JsonSchemaPolicy .check (SETTINGS_LOCATION , "settings file" , jsonObject , LauncherSettings .CURRENT_SCHEMA );
428428 if (!schema .allowSave ()) {
429429 unsupportedVersion = true ;
430430 }
431431 if (!schema .readable ()) {
432- return new Config ();
432+ return new LauncherSettings ();
433433 }
434434
435435 migratedGameAccounts = LegacyConfigMigrator .extractAccountStorages (jsonObject );
@@ -438,20 +438,20 @@ private static Config loadConfig() throws IOException {
438438 }
439439
440440 try {
441- Config settings = Config .fromJson (jsonObject );
441+ LauncherSettings settings = LauncherSettings .fromJson (jsonObject );
442442 if (settings == null ) {
443- return new Config ();
443+ return new LauncherSettings ();
444444 }
445445
446- if (!schema .preserveSchema () && !Config .CURRENT_SCHEMA .equals (settings .schemaProperty ().get ())) {
447- settings .schemaProperty ().set (Config .CURRENT_SCHEMA );
446+ if (!schema .preserveSchema () && !LauncherSettings .CURRENT_SCHEMA .equals (settings .schemaProperty ().get ())) {
447+ settings .schemaProperty ().set (LauncherSettings .CURRENT_SCHEMA );
448448 }
449449
450450 return settings ;
451451 } catch (JsonParseException e ) {
452452 needBackupSettings = true ;
453453 LOG .warning ("Failed to parse settings file: " + SETTINGS_LOCATION , e );
454- return new Config ();
454+ return new LauncherSettings ();
455455 }
456456 } else {
457457 LegacyConfigMigrator .MigrationResult migrationResult = LegacyConfigMigrator .migrateLegacyConfig ();
@@ -463,11 +463,11 @@ private static Config loadConfig() throws IOException {
463463 migratedAuthlibInjectorServers = migrationResult .authlibInjectorServers ();
464464 migratedGameAccounts = migrationResult .accountStorages ();
465465 FileUtils .saveSafely (SETTINGS_LOCATION , migrationResult .contentForMigration ());
466- return migrationResult .config ();
466+ return migrationResult .launcherSettings ();
467467 }
468468 }
469469
470- var newSettings = new Config ();
470+ var newSettings = new LauncherSettings ();
471471 newlyCreated = true ;
472472 return newSettings ;
473473 }
@@ -654,13 +654,13 @@ private static void checkWritable(Path location) throws IOException {
654654 if (OperatingSystem .CURRENT_OS == OperatingSystem .WINDOWS
655655 && location .getFileSystem () == FileSystems .getDefault ()
656656 && location .toFile ().canWrite ()) {
657- LOG .warning ("Config at " + location + " is not writable, but it seems to be a Samba share or OpenJDK bug" );
657+ LOG .warning ("Launcher settings at " + location + " is not writable, but it seems to be a Samba share or OpenJDK bug" );
658658 // There are some serious problems with the implementation of Samba or OpenJDK
659659 throw new SambaException ();
660660 } else {
661661 // the config cannot be saved
662662 // throw up the error now to prevent further data loss
663- throw new IOException ("Config at " + location + " is not writable" );
663+ throw new IOException ("Launcher settings at " + location + " is not writable" );
664664 }
665665 }
666666 }
@@ -672,7 +672,7 @@ private static GlobalConfig loadGlobalConfig() throws IOException {
672672 String content = Files .readString (GLOBAL_CONFIG_PATH );
673673 GlobalConfig deserialized = GlobalConfig .fromJson (content );
674674 if (deserialized == null ) {
675- LOG .info ("Config is empty" );
675+ LOG .info ("Global config is empty" );
676676 } else {
677677 return deserialized ;
678678 }
0 commit comments