Skip to content

Commit

Permalink
Fix leaves update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluemangoo committed Mar 25, 2024
1 parent a4a3a92 commit f087ccd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0103-Leaves-update-command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..293117a6c54fdce70d69b93fe80ce021
+}
diff --git a/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java b/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..e7060b91a27b1d0cddb14c155caaa0e78a043e20
index 0000000000000000000000000000000000000000..e633cd03d3877280e892acf47527c1731e4edb1e
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java
@@ -0,0 +1,234 @@
Expand Down Expand Up @@ -249,7 +249,7 @@ index 0000000000000000000000000000000000000000..e7060b91a27b1d0cddb14c155caaa0e7
+
+ private static LeavesBuildInfo getLatestBuildInfo(String mcVersion, String gitHash) {
+ try {
+ HttpURLConnection connection = (HttpURLConnection) new URL("https://api.leavesmc.top/projects/leaves/versions/" + mcVersion + "/builds/latest").openConnection();
+ HttpURLConnection connection = (HttpURLConnection) new URL("https://api.leavesmc.top/v2/projects/leaves/versions/" + mcVersion + "/builds/latest").openConnection();
+ connection.connect();
+ if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) return LeavesBuildInfo.NULL;
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), Charsets.UTF_8))) {
Expand Down

0 comments on commit f087ccd

Please sign in to comment.