Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-20 06:50:08 +01:00
Use own update site
Dieser Commit ist enthalten in:
Ursprung
82e05afacf
Commit
dcd4502f5a
@ -35,9 +35,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
|||||||
public final class UpdateUtil {
|
public final class UpdateUtil {
|
||||||
|
|
||||||
private static final String PREFIX = "§a§l[ViaVersion] §a";
|
private static final String PREFIX = "§a§l[ViaVersion] §a";
|
||||||
private static final String URL = "https://api.github.com/repos/ViaVersion/";
|
private static final String URL = "https://update.viaversion.com";
|
||||||
private static final String PLUGIN = "ViaVersion";
|
private static final String PLUGIN = "/ViaVersion/";
|
||||||
private static final String LATEST_VERSION = "/releases/latest";
|
|
||||||
|
|
||||||
public static void sendUpdateMessage(final UUID uuid) {
|
public static void sendUpdateMessage(final UUID uuid) {
|
||||||
Via.getPlatform().runAsync(() -> {
|
Via.getPlatform().runAsync(() -> {
|
||||||
@ -91,7 +90,7 @@ public final class UpdateUtil {
|
|||||||
|
|
||||||
private static @Nullable String getNewestVersion() {
|
private static @Nullable String getNewestVersion() {
|
||||||
try {
|
try {
|
||||||
URL url = new URL(URL + PLUGIN + LATEST_VERSION + "?" + System.currentTimeMillis());
|
URL url = new URL(URL + PLUGIN);
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||||
connection.setUseCaches(false);
|
connection.setUseCaches(false);
|
||||||
connection.addRequestProperty("User-Agent", "ViaVersion " + Via.getPlatform().getPluginVersion() + " " + Via.getPlatform().getPlatformName());
|
connection.addRequestProperty("User-Agent", "ViaVersion " + Via.getPlatform().getPluginVersion() + " " + Via.getPlatform().getPlatformName());
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren