├── README.md └── src ├── fr └── trxyy │ └── launcher │ └── template │ ├── LauncherMain.java │ ├── LauncherPanel.java │ └── SettingsPanel.java └── resources ├── Comfortaa-Regular.ttf ├── Duncaster.otf ├── Stratum.ttf ├── StratumM.ttf ├── alternativeapi_logo.png ├── background.mp4 ├── close.png ├── favicon.png ├── hide.png └── reduce.png /README.md: -------------------------------------------------------------------------------- 1 | ![Logo](https://nsa40.casimages.com/img/2020/05/07/200507103021373167.png) 2 | -------------------------------------------------------------------------------- /src/fr/trxyy/launcher/template/LauncherMain.java: -------------------------------------------------------------------------------- 1 | package fr.trxyy.launcher.template; 2 | 3 | import fr.trxyy.alternative.alternative_apiv2.base.AlternativeBase; 4 | import fr.trxyy.alternative.alternative_apiv2.base.GameConnect; 5 | import fr.trxyy.alternative.alternative_apiv2.base.GameEngine; 6 | import fr.trxyy.alternative.alternative_apiv2.base.GameFolder; 7 | import fr.trxyy.alternative.alternative_apiv2.base.GameLinks; 8 | import fr.trxyy.alternative.alternative_apiv2.base.LauncherBackground; 9 | import fr.trxyy.alternative.alternative_apiv2.base.LauncherBase; 10 | import fr.trxyy.alternative.alternative_apiv2.base.LauncherPane; 11 | import fr.trxyy.alternative.alternative_apiv2.base.LauncherPreferences; 12 | import fr.trxyy.alternative.alternative_apiv2.base.WindowStyle; 13 | import fr.trxyy.alternative.alternative_apiv2.utils.Mover; 14 | import fr.trxyy.alternative.alternative_authv2.base.Logger; 15 | import javafx.application.Application; 16 | import javafx.scene.Parent; 17 | import javafx.scene.Scene; 18 | import javafx.stage.Stage; 19 | import javafx.stage.StageStyle; 20 | 21 | public class LauncherMain extends AlternativeBase { 22 | public static GameFolder GAME_FOLDER = new GameFolder("minecraft2022-ar"); 23 | private GameLinks GAME_LINKS = new GameLinks("http://localhost/alternative_versions/forge/", "1.19.2-forge-43.1.1.json"); 24 | private LauncherPreferences LAUNCHER_PREFS = new LauncherPreferences("Launcher Template AlternativeAPI v3.0", 880, 520, Mover.MOVE); 25 | private GameEngine GAME_ENGINE = new GameEngine(GAME_FOLDER, GAME_LINKS, LAUNCHER_PREFS); 26 | private GameConnect GAME_CONNECT = new GameConnect("mc.hypixel.net", "25565"); 27 | 28 | public void start(Stage primaryStage) throws Exception { 29 | Scene scene = new Scene(this.createContent()); 30 | LauncherBase launcher = new LauncherBase(primaryStage, scene, StageStyle.TRANSPARENT, this.GAME_ENGINE); 31 | launcher.setIconImage(primaryStage, "favicon.png"); 32 | } 33 | 34 | private Parent createContent() { 35 | LauncherPane contentPane = new LauncherPane(this.GAME_ENGINE, 5, WindowStyle.TRANSPARENT); 36 | /** Direct Connect **/ 37 | this.GAME_ENGINE.reg(GAME_CONNECT); 38 | new LauncherBackground(this.GAME_ENGINE, "background.mp4", contentPane); 39 | new LauncherPanel(contentPane, this.GAME_ENGINE); 40 | return contentPane; 41 | } 42 | 43 | public static void main(String[] args) { 44 | Logger.log("Fabric, Forge & Optifine works perfectly ! (Launcher)"); 45 | Application.launch(args); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/fr/trxyy/launcher/template/LauncherPanel.java: -------------------------------------------------------------------------------- 1 | package fr.trxyy.launcher.template; 2 | 3 | import java.io.File; 4 | import java.util.UUID; 5 | 6 | import javax.swing.JDialog; 7 | import javax.swing.JFrame; 8 | 9 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherAlert; 10 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherButton; 11 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherImage; 12 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherLabel; 13 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherPasswordField; 14 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherProgressBar; 15 | import fr.trxyy.alternative.alternative_api_uiv2.components.LauncherTextField; 16 | import fr.trxyy.alternative.alternative_apiv2.base.GameEngine; 17 | import fr.trxyy.alternative.alternative_apiv2.base.IScreen; 18 | import fr.trxyy.alternative.alternative_apiv2.settings.UsernameSaver; 19 | import fr.trxyy.alternative.alternative_apiv2.updater.GameUpdater; 20 | import fr.trxyy.alternative.alternative_apiv2.utils.FontLoader; 21 | import fr.trxyy.alternative.alternative_apiv2.utils.Mover; 22 | import fr.trxyy.alternative.alternative_authv2.base.GameAuth; 23 | import fr.trxyy.alternative.alternative_authv2.base.Session; 24 | import javafx.animation.Animation; 25 | import javafx.animation.KeyFrame; 26 | import javafx.animation.KeyValue; 27 | import javafx.animation.Timeline; 28 | import javafx.event.ActionEvent; 29 | import javafx.event.EventHandler; 30 | import javafx.geometry.Pos; 31 | import javafx.scene.image.Image; 32 | import javafx.scene.layout.Pane; 33 | import javafx.scene.paint.Color; 34 | import javafx.scene.shape.Rectangle; 35 | import javafx.scene.text.Font; 36 | import javafx.stage.Stage; 37 | import javafx.util.Duration; 38 | 39 | public class LauncherPanel extends IScreen { 40 | /** TOP */ 41 | private LauncherButton closeButton; 42 | private LauncherButton reduceButton; 43 | /** LOGIN */ 44 | private LauncherTextField usernameField; 45 | private LauncherPasswordField passwordField; 46 | private LauncherButton loginButton, microsoftButton, settingsButton; 47 | /** USERNAME SAVER */ 48 | public UsernameSaver usernameSaver; 49 | /** GAMEENGINE, UPDATE */ 50 | private GameEngine gameEngine; 51 | private LauncherProgressBar progressBar; 52 | private LauncherLabel updateLabel; 53 | private Rectangle updateRectangle; 54 | private Thread updateThread; 55 | private GameUpdater updater; 56 | /** LOGGED IN **/ 57 | private Rectangle loggedRectangle; 58 | private LauncherImage headImage; 59 | private LauncherLabel accountLabel; 60 | /** SETTINGS **/ 61 | private GameAuth gameAuth; 62 | private Session gameSession; 63 | private Font customFont = FontLoader.loadFont("Comfortaa-Regular.ttf", "Comfortaa", 18F); 64 | 65 | public LauncherPanel(Pane root, GameEngine engine) { 66 | this.gameEngine = engine; 67 | this.usernameSaver = new UsernameSaver(engine); 68 | 69 | this.drawRect(root, 0, 0, gameEngine.getWidth(), gameEngine.getHeight(), Color.rgb(255, 255, 255, 0.10)); 70 | /** ===================== RECTANGLE NOIR EN BAS ===================== */ 71 | this.drawRect(root, 0, engine.getHeight() - 110, engine.getWidth(), 300, Color.rgb(0, 0, 0, 0.4)); 72 | /** ===================== AFFICHER UN LOGO ===================== */ 73 | this.drawImage(gameEngine, loadImage(gameEngine, "alternativeapi_logo.png"), 0, this.gameEngine.getHeight() - 100, 400, 100, root, Mover.DONT_MOVE); 74 | /** ===================== BOUTON FERMER ===================== */ 75 | this.closeButton = new LauncherButton(root); 76 | this.closeButton.setInvisible(); 77 | this.closeButton.setBounds(gameEngine.getWidth() - 50, -3, 40, 20); 78 | LauncherImage closeImage = new LauncherImage(root, loadImage(gameEngine, "close.png")); 79 | closeImage.setSize(40, 20); 80 | this.closeButton.setGraphic(closeImage); 81 | this.closeButton.setOnAction(new EventHandler() { 82 | public void handle(ActionEvent event) { 83 | System.exit(0); 84 | } 85 | }); 86 | /** ===================== BOUTON REDUIRE ===================== */ 87 | this.reduceButton = new LauncherButton(root); 88 | this.reduceButton.setInvisible(); 89 | this.reduceButton.setBounds(gameEngine.getWidth() - 91, -3, 40, 20); 90 | LauncherImage reduceImage = new LauncherImage(root, loadImage(gameEngine, "reduce.png")); 91 | reduceImage.setSize(40, 20); 92 | this.reduceButton.setGraphic(reduceImage); 93 | this.reduceButton.setOnAction(new EventHandler() { 94 | public void handle(ActionEvent event) { 95 | Stage stage = (Stage) ((LauncherButton) event.getSource()).getScene().getWindow(); 96 | stage.setIconified(true); 97 | } 98 | }); 99 | /** ===================== CASE PSEUDONYME ===================== */ 100 | this.usernameField = new LauncherTextField(usernameSaver.getUsername(), root); 101 | this.usernameField.setBounds(this.gameEngine.getWidth() - 360, this.gameEngine.getHeight() - 100, 220, 20); 102 | this.setFontSize(14.0F); 103 | this.usernameField.setFont(this.customFont); 104 | this.usernameField.addStyle("-fx-background-color: rgb(230, 230, 230);"); 105 | this.usernameField.addStyle("-fx-text-fill: black;"); 106 | this.usernameField.addStyle("-fx-border-radius: 0 0 0 0;"); 107 | this.usernameField.addStyle("-fx-background-radius: 0 0 0 0;"); 108 | this.usernameField.setVoidText("Nom de compte"); 109 | /** ===================== CASE MOT DE PASSE ===================== */ 110 | this.passwordField = new LauncherPasswordField(root); 111 | this.passwordField.setBounds(this.gameEngine.getWidth() - 360, this.gameEngine.getHeight() - 65, 220, 20); 112 | this.setFontSize(14.0F); 113 | this.passwordField.setFont(this.customFont); 114 | this.passwordField.addStyle("-fx-background-color: rgb(230, 230, 230);"); 115 | this.passwordField.addStyle("-fx-text-fill: black;"); 116 | this.passwordField.addStyle("-fx-border-radius: 0 0 0 0;"); 117 | this.passwordField.addStyle("-fx-background-radius: 0 0 0 0;"); 118 | this.passwordField.setVoidText("Mot de passe (vide = crack)"); 119 | /** ===================== BOUTON DE CONNEXION ===================== */ 120 | this.loginButton = new LauncherButton("Se connecter", root); 121 | this.setFontSize(12.5F); 122 | this.loginButton.setFont(this.customFont); 123 | this.loginButton.setBounds(this.gameEngine.getWidth() - 130, this.gameEngine.getHeight() - 64, 105, 20); 124 | this.loginButton.addStyle("-fx-background-color: rgb(230, 230, 230);"); 125 | this.loginButton.addStyle("-fx-text-fill: black;"); 126 | this.loginButton.addStyle("-fx-border-radius: 0 0 0 0;"); 127 | this.loginButton.addStyle("-fx-background-radius: 0 0 0 0;"); 128 | this.loginButton.setOnAction(new EventHandler() { 129 | 130 | public void handle(ActionEvent event) { 131 | usernameSaver.saveSettings(usernameField.getText()); 132 | /** 133 | * ===================== AUTHENTIFICATION OFFLINE (CRACK) ===================== 134 | */ 135 | if (usernameField.getText().length() < 1) { 136 | new LauncherAlert("Le pseudonyme n'est pas assez long (3 caracteres minimum.)", 137 | "Il y a un probleme lors de la tentative de connexion: Le pseudonyme doit comprendre au moins 3 caracteres."); 138 | } else if (usernameField.getText().length() > 1 && passwordField.getText().isEmpty()) { 139 | gameSession = new Session(usernameField.getText(), UUID.randomUUID().toString(), UUID.randomUUID().toString()); 140 | File jsonFile = downloadVersion(engine.getGameLinks().getJsonUrl(), engine); 141 | updateGame(gameSession, jsonFile); 142 | } 143 | } 144 | }); 145 | /** ===================== BOUTON DES OPTIONS ===================== */ 146 | this.settingsButton = new LauncherButton("Options", root); 147 | this.setFontSize(12.5F); 148 | this.settingsButton.setFont(this.customFont); 149 | this.settingsButton.setBounds(this.gameEngine.getWidth() - 130, this.gameEngine.getHeight() - 99, 105, 20); 150 | this.settingsButton.addStyle("-fx-background-color: rgb(230, 230, 230);"); 151 | this.settingsButton.addStyle("-fx-text-fill: black;"); 152 | this.settingsButton.addStyle("-fx-border-radius: 0 0 0 0;"); 153 | this.settingsButton.addStyle("-fx-background-radius: 0 0 0 0;"); 154 | this.settingsButton.setOnAction(new EventHandler() { 155 | 156 | public void handle(ActionEvent event) { 157 | final JDialog frame = new JDialog(); 158 | frame.setTitle("Modification des parametres"); 159 | frame.setContentPane(new SettingsPanel(engine)); 160 | frame.setResizable(false); 161 | frame.setModal(true); 162 | frame.setLocationRelativeTo(null); 163 | frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); 164 | frame.setSize(630, 210); 165 | frame.setVisible(true); 166 | } 167 | }); 168 | /** ===================== BOUTON DE CONNEXION MICROSOFT ===================== */ 169 | this.microsoftButton = new LauncherButton("Connexion avec Microsoft", root); 170 | this.setFontSize(12.5F); 171 | this.microsoftButton.setFont(this.customFont); 172 | this.microsoftButton.setBounds(this.gameEngine.getWidth() - 345, this.gameEngine.getHeight() - 33, 190, 20); 173 | this.microsoftButton.addStyle("-fx-background-color: rgb(230, 230, 230);"); 174 | this.microsoftButton.addStyle("-fx-text-fill: black;"); 175 | this.microsoftButton.addStyle("-fx-border-radius: 0 0 0 0;"); 176 | this.microsoftButton.addStyle("-fx-background-radius: 0 0 0 0;"); 177 | this.microsoftButton.setOnAction(new EventHandler() { 178 | 179 | public void handle(ActionEvent event) { 180 | gameAuth = new GameAuth(); 181 | showMicrosoftAuth(gameEngine, gameAuth); 182 | if (gameAuth.isLogged()) { 183 | gameSession = gameAuth.getSession(); 184 | File jsonFile = downloadVersion(engine.getGameLinks().getJsonUrl(), engine); 185 | updateGame(gameSession, jsonFile); 186 | } 187 | } 188 | }); 189 | 190 | /** ======================================================== **/ 191 | this.updateLabel = new LauncherLabel(root); 192 | this.updateLabel.setText("Mise a jour..."); 193 | this.setFontSize(30.0F); 194 | this.updateLabel.setFont(this.customFont); 195 | this.updateLabel.setBounds(this.gameEngine.getWidth() - 250, this.gameEngine.getHeight() - 70, 230, 20); 196 | this.updateLabel.addStyle("-fx-text-fill: white;"); 197 | this.updateLabel.setOpacity(0.0D); 198 | this.updateLabel.setVisible(false); 199 | 200 | this.loggedRectangle = this.drawRect(root, this.gameEngine.getWidth() / 2 - 115, 50, 230, 200, Color.rgb(0, 0, 0, 0.4)); 201 | this.loggedRectangle.setOpacity(0.0D); 202 | this.loggedRectangle.setVisible(false); 203 | 204 | this.headImage = new LauncherImage(root); 205 | this.headImage.setFitWidth(120); 206 | this.headImage.setFitHeight(120); 207 | this.headImage.setLayoutX(this.gameEngine.getWidth() / 2 - 60); 208 | this.headImage.setLayoutY(70); 209 | this.headImage.setOpacity(0.0D); 210 | this.headImage.setVisible(false); 211 | 212 | this.accountLabel = new LauncherLabel(root); 213 | this.accountLabel.setAlignment(Pos.CENTER); 214 | this.setFontSize(20.0F); 215 | this.accountLabel.setFont(this.customFont); 216 | this.accountLabel.setBounds(this.gameEngine.getWidth() / 2 - 110, this.gameEngine.getHeight() / 2 - 50, 220, 20); 217 | this.accountLabel.addStyle("-fx-text-fill: white;"); 218 | this.accountLabel.setOpacity(0.0D); 219 | this.accountLabel.setVisible(false); 220 | 221 | this.updateRectangle = this.drawRect(root, this.gameEngine.getWidth() / 2 - 250, this.gameEngine.getHeight() / 2 + 70, 500, 30, Color.rgb(0, 0, 0, 0.4)); 222 | this.updateRectangle.setOpacity(0.0D); 223 | this.updateRectangle.setVisible(false); 224 | 225 | this.progressBar = new LauncherProgressBar(root); 226 | this.progressBar.setBounds(this.gameEngine.getWidth() / 2 - 245, this.gameEngine.getHeight() / 2 + 75, 490, 21); 227 | this.progressBar.setOpacity(0.0D); 228 | this.progressBar.setVisible(false); 229 | } 230 | 231 | private void updateGame(Session auth, File jsonFile) { 232 | this.accountLabel.setText(auth.getUsername()); 233 | this.fadeOut(this.loginButton, 300).setOnFinished(new EventHandler() { 234 | @Override 235 | public void handle(ActionEvent event) { 236 | loginButton.setVisible(false); 237 | updateLabel.setVisible(true); 238 | fadeIn(updateLabel, 300); 239 | 240 | progressBar.setVisible(true); 241 | fadeIn(progressBar, 300); 242 | 243 | loggedRectangle.setVisible(true); 244 | fadeIn(loggedRectangle, 300); 245 | 246 | headImage.setImage(new Image("https://minotar.net/helm/" + auth.getUsername() + "/120.png")); 247 | headImage.setVisible(true); 248 | fadeIn(headImage, 300); 249 | 250 | updateRectangle.setVisible(true); 251 | fadeIn(updateRectangle, 300); 252 | 253 | loggedRectangle.setVisible(true); 254 | fadeIn(loggedRectangle, 300); 255 | 256 | accountLabel.setVisible(true); 257 | fadeIn(accountLabel, 300); 258 | } 259 | }); 260 | this.fadeOut(this.usernameField, 300).setOnFinished(new EventHandler() { 261 | @Override 262 | public void handle(ActionEvent event) { 263 | usernameField.setVisible(false); 264 | } 265 | }); 266 | this.fadeOut(this.passwordField, 300).setOnFinished(new EventHandler() { 267 | @Override 268 | public void handle(ActionEvent event) { 269 | passwordField.setVisible(false); 270 | } 271 | }); 272 | this.fadeOut(this.settingsButton, 300).setOnFinished(new EventHandler() { 273 | @Override 274 | public void handle(ActionEvent event) { 275 | settingsButton.setVisible(false); 276 | } 277 | }); 278 | this.fadeOut(this.microsoftButton, 300).setOnFinished(new EventHandler() { 279 | @Override 280 | public void handle(ActionEvent event) { 281 | microsoftButton.setVisible(false); 282 | } 283 | }); 284 | 285 | this.updateThread = new Thread() { 286 | public void run() { 287 | updater = new GameUpdater(prepareGameUpdate(updater, gameEngine, auth, jsonFile), gameEngine); 288 | gameEngine.reg(updater); 289 | Timeline t = new Timeline( new KeyFrame[] { new KeyFrame(Duration.seconds(0.0D), new EventHandler() { 290 | public void handle(ActionEvent event) { 291 | double percent = (gameEngine.getGameUpdater().downloadedFiles * 100.0D / gameEngine.getGameUpdater().filesToDownload / 100.0D); 292 | progressBar.setProgress(percent); 293 | updateLabel.setText(gameEngine.getGameUpdater().getUpdateText()); 294 | } 295 | }, new KeyValue[0]), new KeyFrame(Duration.seconds(0.1D), new KeyValue[0]) }); 296 | t.setCycleCount(Animation.INDEFINITE); 297 | t.play(); 298 | downloadGameAndRun(updater, auth); 299 | } 300 | }; 301 | this.updateThread.start(); 302 | } 303 | 304 | private void setFontSize(float size) { 305 | this.customFont = FontLoader.loadFont("Comfortaa-Regular.ttf", "Comfortaa", size); 306 | } 307 | } 308 | -------------------------------------------------------------------------------- /src/fr/trxyy/launcher/template/SettingsPanel.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/fr/trxyy/launcher/template/SettingsPanel.java -------------------------------------------------------------------------------- /src/resources/Comfortaa-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/Comfortaa-Regular.ttf -------------------------------------------------------------------------------- /src/resources/Duncaster.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/Duncaster.otf -------------------------------------------------------------------------------- /src/resources/Stratum.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/Stratum.ttf -------------------------------------------------------------------------------- /src/resources/StratumM.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/StratumM.ttf -------------------------------------------------------------------------------- /src/resources/alternativeapi_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/alternativeapi_logo.png -------------------------------------------------------------------------------- /src/resources/background.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/background.mp4 -------------------------------------------------------------------------------- /src/resources/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/close.png -------------------------------------------------------------------------------- /src/resources/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/favicon.png -------------------------------------------------------------------------------- /src/resources/hide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/hide.png -------------------------------------------------------------------------------- /src/resources/reduce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrxyyDev/AlternativeAPI-launcher/31a5a1cc564d4ad9177462e786c8478d9c03cb48/src/resources/reduce.png --------------------------------------------------------------------------------