Skip to content

Commit

Permalink
Remove broken patch and fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jun 29, 2024
1 parent a4f9ea5 commit d30dbfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions patches/server/0005-Update-version-fetcher-repo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..917ffaae401f3374d07d7fb7c024234a
if (data == null) {
return null;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 5e42a3392fa03813e3e58e80299625993c560396..1fed83a95ae6f3fc805fe5c2e303f4089de194e6 100644
index 5735e6ab4c3530cd296580f9e8dcb107607929b1..1d07f5026243196cff49a81635bd17373b02e591 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -503,7 +503,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
Expand All @@ -41,10 +41,10 @@ index 5e42a3392fa03813e3e58e80299625993c560396..1fed83a95ae6f3fc805fe5c2e303f408
@Override
diff --git a/src/main/java/org/leavesmc/leaves/util/LeavesVersionFetcher.java b/src/main/java/org/leavesmc/leaves/util/LeavesVersionFetcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..b102e2f5cf541b8ced87cf1ec7469ea90da4bb72
index 0000000000000000000000000000000000000000..83f9bf9464ded48858b816107b4f14a065d80399
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/util/LeavesVersionFetcher.java
@@ -0,0 +1,126 @@
@@ -0,0 +1,128 @@
+package org.leavesmc.leaves.util;
+
+import com.destroystokyo.paper.PaperVersionFetcher;
Expand Down Expand Up @@ -89,6 +89,8 @@ index 0000000000000000000000000000000000000000..b102e2f5cf541b8ced87cf1ec7469ea9
+ final ServerBuildInfo build = ServerBuildInfo.buildInfo();
+ if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
+ updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
+ } else if (build.buildNumber().isEmpty()) {
+ updateMessage = text("You are running a development version form CI", color(0xFF5300));
+ } else {
+ updateMessage = getUpdateStatusMessage("LeavesMC/Leaves", build);
+ }
Expand Down Expand Up @@ -160,7 +162,7 @@ index 0000000000000000000000000000000000000000..b102e2f5cf541b8ced87cf1ec7469ea9
+
+ try {
+ try (BufferedReader reader = Resources.asCharSource(
+ URI.create("https://api.leavesmc.org/v2/projects/leaves/versions/" + build.minecraftVersionId() + "/differ/" + build.gitCommit()).toURL(),
+ URI.create("https://api.leavesmc.org/v2/projects/leaves/versions/" + build.minecraftVersionId() + "/differ/" + build.gitCommit().get()).toURL(),
+ Charsets.UTF_8
+ ).openBufferedStream()) {
+ return Integer.parseInt(reader.readLine());
Expand Down

0 comments on commit d30dbfa

Please sign in to comment.