From dd553fa4e2e32e35ce42f906823d56772775a2c6 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Mon, 24 Jun 2019 22:24:57 -0500 Subject: [PATCH] Update VersionFetcher regex for upstream versioning changes Spigot dropped the -R0.1 from their version. `1.14.2-R0.1-SNAPSHOT` -> `1.14.3-SNAPSHOT` If this is changed upstream this commit can be reverted. --- .../Implement-Paper-VersionChecker.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/Implement-Paper-VersionChecker.patch b/Spigot-Server-Patches/Implement-Paper-VersionChecker.patch index 1b6414540c..d4c8c48d72 100644 --- a/Spigot-Server-Patches/Implement-Paper-VersionChecker.patch +++ b/Spigot-Server-Patches/Implement-Paper-VersionChecker.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement Paper VersionChecker diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java new file mode 100644 -index 0000000000..ded51d042b +index 000000000..1279072ff --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -0,0 +0,0 @@ @@ -24,7 +24,7 @@ index 0000000000..ded51d042b +import java.net.URL; + +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 java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9.]*)-(pre[0-9].*-S|S)"); // S is an anchor, will always give '-S' at end + private static final String GITHUB_BRANCH_NAME = "ver/1.14"; + private static @Nullable String mcVer; + @@ -45,7 +45,7 @@ index 0000000000..ded51d042b + java.util.regex.Matcher matcher = VER_PATTERN.matcher(org.bukkit.Bukkit.getBukkitVersion()); + if (matcher.find()) { + String result = matcher.group(); -+ mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-' ++ mcVer = result.substring(0, result.length() - 2); // strip 'S' anchor and trailing '-' + } else { + org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to PaperMC!"); + org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString()); @@ -126,7 +126,7 @@ index 0000000000..ded51d042b + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index f7fdd0727b..ee5616cdfc 100644 +index fa32d4bb7..f9059b257 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {