File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed
HMCL/src/main/java/org/jackhuang/hmcl Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 20
20
import javafx .application .Application ;
21
21
import javafx .application .Platform ;
22
22
import javafx .stage .Stage ;
23
- import org .jackhuang .hmcl .auth .authlibinjector .AuthlibInjectorServer ;
24
- import org .jackhuang .hmcl .setting .Accounts ;
25
- import org .jackhuang .hmcl .setting .AuthlibInjectorServers ;
26
23
import org .jackhuang .hmcl .setting .ConfigHolder ;
27
24
import org .jackhuang .hmcl .task .Schedulers ;
28
25
import org .jackhuang .hmcl .task .TaskExecutor ;
44
41
import java .util .List ;
45
42
import java .util .concurrent .TimeUnit ;
46
43
47
- import static org .jackhuang .hmcl .setting .ConfigHolder .config ;
48
44
import static org .jackhuang .hmcl .ui .FXUtils .runInFX ;
49
45
import static org .jackhuang .hmcl .util .Logging .LOG ;
50
46
import static org .jackhuang .hmcl .util .i18n .I18n .i18n ;
@@ -58,14 +54,6 @@ public void start(Stage primaryStage) {
58
54
try {
59
55
try {
60
56
ConfigHolder .init ();
61
- AuthlibInjectorServers .init ();
62
-
63
- if (ConfigHolder .isNewlyCreated () && !AuthlibInjectorServers .getConfigInstance ().getUrls ().isEmpty ()) {
64
- config ().setPreferredLoginType (Accounts .getLoginType (Accounts .FACTORY_AUTHLIB_INJECTOR ));
65
- AuthlibInjectorServers .getConfigInstance ().getUrls ().stream ()
66
- .map (AuthlibInjectorServer ::new )
67
- .forEach (config ().getAuthlibInjectorServers ()::add );
68
- }
69
57
} catch (IOException e ) {
70
58
Main .showErrorAndExit (i18n ("fatal.config_loading_failure" , Paths .get ("" ).toAbsolutePath ().normalize ()));
71
59
}
Original file line number Diff line number Diff line change 19
19
20
20
import javafx .beans .binding .Bindings ;
21
21
import org .jackhuang .hmcl .Metadata ;
22
+ import org .jackhuang .hmcl .auth .authlibinjector .AuthlibInjectorServer ;
22
23
import org .jackhuang .hmcl .game .HMCLCacheRepository ;
23
24
import org .jackhuang .hmcl .util .CacheRepository ;
24
25
import org .jackhuang .hmcl .util .io .FileUtils ;
@@ -44,6 +45,15 @@ static void init() {
44
45
}
45
46
46
47
private Settings () {
48
+ AuthlibInjectorServers .init ();
49
+
50
+ if (ConfigHolder .isNewlyCreated () && !AuthlibInjectorServers .getConfigInstance ().getUrls ().isEmpty ()) {
51
+ config ().setPreferredLoginType (Accounts .getLoginType (Accounts .FACTORY_AUTHLIB_INJECTOR ));
52
+ AuthlibInjectorServers .getConfigInstance ().getUrls ().stream ()
53
+ .map (AuthlibInjectorServer ::new )
54
+ .forEach (config ().getAuthlibInjectorServers ()::add );
55
+ }
56
+
47
57
DownloadProviders .init ();
48
58
ProxyManager .init ();
49
59
Accounts .init ();
You can’t perform that action at this time.
0 commit comments