From f087ccd0eee5d4c846e89cc2884a29555e3139db Mon Sep 17 00:00:00 2001 From: Bluemangoo Date: Mon, 25 Mar 2024 03:08:43 +0000 Subject: [PATCH] Fix leaves update --- patches/server/0103-Leaves-update-command.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0103-Leaves-update-command.patch b/patches/server/0103-Leaves-update-command.patch index f881162a..46b4716d 100644 --- a/patches/server/0103-Leaves-update-command.patch +++ b/patches/server/0103-Leaves-update-command.patch @@ -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 @@ @@ -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))) {