public class MojangAuthenticationService extends AuthenticationService
| Constructor and Description |
|---|
MojangAuthenticationService()
Creates a new AuthenticationService instance.
|
MojangAuthenticationService(String clientToken)
Creates a new AuthenticationService instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canMigrate()
Checks if the current profile is eligible to migrate to a Microsoft account.
|
String |
getClientToken() |
String |
getId()
Gets the ID of the user logged in with the service.
|
void |
login()
Logs the service in.
|
void |
logout()
Logs the service out.
|
void |
selectGameProfile(GameProfile profile)
Selects a game profile.
|
String |
toString() |
getAccessToken, getAvailableProfiles, getPassword, getProperties, getSelectedProfile, getUsername, isLoggedIn, setAccessToken, setPassword, setUsernamegetBaseUri, getEndpointUri, getEndpointUri, getProxy, setBaseUri, setBaseUri, setProxypublic MojangAuthenticationService()
public MojangAuthenticationService(String clientToken)
clientToken - Client token to use when making authentication requests.public String getId()
public String getClientToken()
public void login()
throws RequestException
AuthenticationServicelogin in class AuthenticationServiceRequestException - If an error occurs while making the request.public void logout()
throws RequestException
AuthenticationServicelogout in class AuthenticationServiceRequestException - If an error occurs while making the request.public void selectGameProfile(GameProfile profile) throws RequestException
profile - Profile to select.RequestException - If an error occurs while making the request.public boolean canMigrate()
throws RequestException
RequestException - If an error occurs while making the request.Copyright © 2023. All rights reserved.