Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leaves update #196

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用新域名 leavesmc.org

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新域名和旧的表现好像有一点区别(

我把所有的域名都改过来好了。

+ 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
Loading