-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from unmojang/evan-goode/legacy
Support authlib-injector accounts on legacy versions
- Loading branch information
Showing
7 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
libraries/launcher/legacy/org/prismlauncher/legacy/utils/api/ApiServers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
/* | ||
* Fjord Launcher - Minecraft Launcher | ||
* Copyright (C) 2024 Evan Goode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.prismlauncher.legacy.utils.api; | ||
|
||
public class ApiServers { | ||
public static String getAuthURL() { | ||
return getPropertyWithFallback("minecraft.api.auth.host", "https://authserver.mojang.com"); | ||
} | ||
public static String getAccountURL() { | ||
return getPropertyWithFallback("minecraft.api.account.host", "https://api.mojang.com"); | ||
} | ||
public static String getSessionURL() { | ||
return getPropertyWithFallback("minecraft.api.session.host", "https://sessionserver.mojang.com"); | ||
} | ||
public static String getServicesURL() { | ||
return getPropertyWithFallback("minecraft.api.services.host", "https://api.minecraftservices.com"); | ||
} | ||
private static String getPropertyWithFallback(String key, String fallback) { | ||
String value = System.getProperty(key); | ||
if (value == null) { | ||
return fallback; | ||
} | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters