Advertisement
Guest User

Launcher.java

a guest
Dec 6th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. package fr.lightskraft.parasium.launcher;
  2.  
  3. import java.io.File;
  4.  
  5. import fr.theshark34.openauth.AuthPoints;
  6. import fr.theshark34.openauth.AuthenticationException;
  7. import fr.theshark34.openauth.Authenticator;
  8. import fr.theshark34.openauth.model.AuthAgent;
  9. import fr.theshark34.openauth.model.response.AuthResponse;
  10. import fr.theshark34.openlauncherlib.launcher.AuthInfos;
  11. import fr.theshark34.openlauncherlib.launcher.GameInfos;
  12. import fr.theshark34.openlauncherlib.launcher.GameTweak;
  13. import fr.theshark34.openlauncherlib.launcher.GameType;
  14. import fr.theshark34.openlauncherlib.launcher.GameVersion;
  15.  
  16. public class Launcher {
  17.  
  18. public static final GameVersion PA_VERSION = new GameVersion("1.12.2", GameType.V1_8_HIGHER);
  19. public static final GameInfos PA_INFOS = new GameInfos("Parasium", PA_VERSION, true, new GameTweak[] {GameTweak.FORGE});
  20. public static final File PA_DIR = PA_INFOS.getGameDir();
  21.  
  22. private static AuthInfos authInfos;
  23.  
  24. public static void auth(String username, String password) throws AuthenticationException {
  25. Authenticator authenticator = new Authenticator(Authenticator.MOJANG_AUTH_URL, AuthPoints.NORMAL_AUTH_POINTS);
  26. AuthResponse response = authenticator.authenticate(AuthAgent.MINECRAFT, username, password, "");
  27. authInfos = new AuthInfos(response.getSelectedProfile().getName(), response.getAccessToken(), response.getSelectedProfile().getId());
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement