From fba2ddfedca48d4e54ccb8cb57a466fcb58963d3 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Fri, 22 Apr 2022 00:27:06 -0500 Subject: [PATCH] Consolidate more patches --- .../server/0019-Fix-compiling-errors.patch | 27 +++++++++------- patches/server/0020-Fix-updater.patch | 32 ------------------- 2 files changed, 16 insertions(+), 43 deletions(-) delete mode 100644 patches/server/0020-Fix-updater.patch diff --git a/patches/server/0019-Fix-compiling-errors.patch b/patches/server/0019-Fix-compiling-errors.patch index bc0b1c9..dd62a43 100644 --- a/patches/server/0019-Fix-compiling-errors.patch +++ b/patches/server/0019-Fix-compiling-errors.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix compiling errors diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index f92610edcfb724374c69e66443eab60919ee955a..153c06bc00c4619012e77cb496ac57a7f2fc9409 100644 +index f92610edcfb724374c69e66443eab60919ee955a..1531d21c6e73ae69ec728d107b917967e0c6222b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -@@ -18,6 +18,7 @@ import java.io.*; +@@ -18,10 +18,12 @@ import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.util.stream.StreamSupport; @@ -16,24 +16,29 @@ index f92610edcfb724374c69e66443eab60919ee955a..153c06bc00c4619012e77cb496ac57a7 public class PaperVersionFetcher implements VersionFetcher { private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end -@@ -57,14 +58,14 @@ public class PaperVersionFetcher implements VersionFetcher { +- private static final String GITHUB_BRANCH_NAME = getBranch(); ++ // Scissors - This must be changed manually for update checking to work ++ private static final String GITHUB_BRANCH_NAME = "ver/1.18.2"; + private static final String DOWNLOAD_PAGE = "https://ci.plex.us.org/job/Scissors/job/" + GITHUB_BRANCH_NAME; + private static @Nullable String mcVer; + +@@ -56,15 +58,10 @@ public class PaperVersionFetcher implements VersionFetcher { + return mcVer; } - // Scissors start - Allow getting git information +- // Scissors start - Allow getting git information - public static String getCommit() { - Map attributes = JarManifests.MANIFEST_MAP; - return attributes.get("Git-Commit"); -+ private static String getCommit() { -+ final var manifest = JarManifests.manifest(Bukkit.getServer().getClass()); -+ return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Commit"); - } - +- } +- - public static String getBranch() { - Map attributes = JarManifests.MANIFEST_MAP; - return attributes.get("Git-Branch"); -+ private static String getBranch() { ++ // Scissors start - Allow getting Git commit ++ private static String getCommit() { + final var manifest = JarManifests.manifest(Bukkit.getServer().getClass()); -+ return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Branch"); ++ return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Commit"); } // Scissors end diff --git a/patches/server/0020-Fix-updater.patch b/patches/server/0020-Fix-updater.patch deleted file mode 100644 index 69529a2..0000000 --- a/patches/server/0020-Fix-updater.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Telesphoreo -Date: Tue, 19 Apr 2022 20:08:56 -0500 -Subject: [PATCH] Fix updater - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 153c06bc00c4619012e77cb496ac57a7f2fc9409..400103cc5cfd6d796e1f2b1ab18e98aea2a0f858 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -@@ -22,7 +22,8 @@ import org.bukkit.Bukkit; - - public class PaperVersionFetcher implements VersionFetcher { - private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end -- private static final String GITHUB_BRANCH_NAME = getBranch(); -+ // Scissors - This must be changed manually for update checking to work -+ private static final String GITHUB_BRANCH_NAME = "ver/1.18.2"; - private static final String DOWNLOAD_PAGE = "https://ci.plex.us.org/job/Scissors/job/" + GITHUB_BRANCH_NAME; - private static @Nullable String mcVer; - -@@ -62,11 +63,6 @@ public class PaperVersionFetcher implements VersionFetcher { - final var manifest = JarManifests.manifest(Bukkit.getServer().getClass()); - return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Commit"); - } -- -- private static String getBranch() { -- final var manifest = JarManifests.manifest(Bukkit.getServer().getClass()); -- return manifest == null ? null : manifest.getMainAttributes().getValue("Git-Branch"); -- } - // Scissors end - - private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {