mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-04-12 18:30:26 +08:00
commit
This commit is contained in:
parent
c33383733f
commit
3e5823b647
@ -52,15 +52,20 @@ public class ServerPlugin implements IPlugin {
|
||||
public void onRegisterAuthenticators(Consumer<IAuthenticator> apply) {
|
||||
String clientToken = Settings.getInstance().getClientToken();
|
||||
MFCRAFT_LOGIN = new MFCraftAuthenticator(clientToken);
|
||||
MFCRAFT_LOGIN.onLoadSettings(Settings.getInstance().getAuthenticatorConfig(MFCRAFT_LOGIN.id()));
|
||||
YGGDRASIL_LOGIN = new YggdrasilAuthenticator(clientToken);
|
||||
YGGDRASIL_LOGIN.onLoadSettings(Settings.getInstance().getYggdrasilConfig());
|
||||
YGGDRASIL_LOGIN.onLoadSettings(Settings.getInstance().getAuthenticatorConfig(YGGDRASIL_LOGIN.id()));
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
Settings.getInstance().setAuthenticatorConfig(MFCRAFT_LOGIN.id(), MFCRAFT_LOGIN.onSaveSettings());
|
||||
Settings.getInstance().setAuthenticatorConfig(YGGDRASIL_LOGIN.id(), YGGDRASIL_LOGIN.onSaveSettings());
|
||||
}));
|
||||
apply.accept(MFCRAFT_LOGIN);
|
||||
apply.accept(YGGDRASIL_LOGIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showUI() {
|
||||
MainFrame.showMainFrame(Settings.isFirstLoading());
|
||||
MainFrame.showMainFrame();
|
||||
}
|
||||
|
||||
public static ServerInfo lastServerInfo;
|
||||
|
@ -59,6 +59,11 @@ public class MFCraftAuthenticator extends IAuthenticator {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String id() {
|
||||
return "mfcraft";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "MFCraft";
|
||||
|
Loading…
x
Reference in New Issue
Block a user