From c50ed524edad22284b5fc5a516d1d8b9749f04a0 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sat, 26 Mar 2022 22:13:07 -0500 Subject: [PATCH] Don't rely on Jenkins / Paper API --- .../0017-Change-version-fetcher-to-AMG.patch | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/patches/server/0017-Change-version-fetcher-to-AMG.patch b/patches/server/0017-Change-version-fetcher-to-AMG.patch index be9bb7e..e925f75 100644 --- a/patches/server/0017-Change-version-fetcher-to-AMG.patch +++ b/patches/server/0017-Change-version-fetcher-to-AMG.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Change version fetcher to AMG diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index ece77f5ea4b14bbed7c070131b3251ea86764538..b91e2b79d85f94ccd041c4260c2a2b23a709ad85 100644 +index ece77f5ea4b14bbed7c070131b3251ea86764538..bba6e4b2add0b21d455f623ae01cadb901621fd9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -19,7 +19,7 @@ import java.util.stream.StreamSupport; @@ -28,3 +28,19 @@ index ece77f5ea4b14bbed7c070131b3251ea86764538..b91e2b79d85f94ccd041c4260c2a2b23 final Component history = getHistory(); return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; +@@ -56,13 +56,8 @@ public class PaperVersionFetcher implements VersionFetcher { + + private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) { + int distance; +- try { +- int jenkinsBuild = Integer.parseInt(versionInfo); +- distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion()); +- } catch (NumberFormatException ignored) { +- versionInfo = versionInfo.replace("\"", ""); +- distance = fetchDistanceFromGitHub(repo, branch, versionInfo); +- } ++ versionInfo = versionInfo.replace("\"", ""); ++ distance = fetchDistanceFromGitHub(repo, branch, versionInfo); + + switch (distance) { + case -1: