mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 14:51:27 +01:00
Revert "Update VersionFetcher regex for upstream versioning changes"
This reverts commit dd553fa4e2
.
This commit is contained in:
parent
da6d8e9da9
commit
6cbdc109ab
@ -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
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 000000000..1279072ff
|
index 0000000000..ded51d042b
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
@ -24,7 +24,7 @@ index 000000000..1279072ff
|
|||||||
+import java.net.URL;
|
+import java.net.URL;
|
||||||
+
|
+
|
||||||
+public class PaperVersionFetcher implements VersionFetcher {
|
+public class PaperVersionFetcher implements VersionFetcher {
|
||||||
+ 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 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 = "ver/1.14";
|
+ private static final String GITHUB_BRANCH_NAME = "ver/1.14";
|
||||||
+ private static @Nullable String mcVer;
|
+ private static @Nullable String mcVer;
|
||||||
+
|
+
|
||||||
@ -45,7 +45,7 @@ index 000000000..1279072ff
|
|||||||
+ java.util.regex.Matcher matcher = VER_PATTERN.matcher(org.bukkit.Bukkit.getBukkitVersion());
|
+ java.util.regex.Matcher matcher = VER_PATTERN.matcher(org.bukkit.Bukkit.getBukkitVersion());
|
||||||
+ if (matcher.find()) {
|
+ if (matcher.find()) {
|
||||||
+ String result = matcher.group();
|
+ String result = matcher.group();
|
||||||
+ mcVer = result.substring(0, result.length() - 2); // strip 'S' anchor and trailing '-'
|
+ mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
|
||||||
+ } else {
|
+ } else {
|
||||||
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to PaperMC!");
|
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to PaperMC!");
|
||||||
+ org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
|
+ org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
|
||||||
@ -126,7 +126,7 @@ index 000000000..1279072ff
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
index fa32d4bb7..f9059b257 100644
|
index f7fdd0727b..ee5616cdfc 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||||
+++ b/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 {
|
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||||
|
Loading…
Reference in New Issue
Block a user