Skip to content

Commit

Permalink
fix spigot version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
steve4744 committed Oct 27, 2022
1 parent d76cc3d commit 12ca10a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/io/github/steve4744/ParkourTopTen/VersionChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ public class VersionChecker {

public static String getVersion(){
try {
HttpURLConnection con = (HttpURLConnection) new URL("https://www.spigotmc.org/api/general.php").openConnection();
HttpURLConnection con = (HttpURLConnection) new URL("https://api.spigotmc.org/legacy/update.php?resource=46268").openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.getOutputStream().write(("key=98BE0FE67F88AB82B4C197FAF1DC3B69206EFDCC4D3B80FC83A00037510B99B4&resource=46268").getBytes("UTF-8"));
con.setRequestMethod("GET");
String version = new BufferedReader(new InputStreamReader(con.getInputStream())).readLine();
con.disconnect();
if (version.length() <= 7) {
return version;
}
} catch (Exception ex) {
Bukkit.getLogger().info("Failed to check for update on Spigot.");
Bukkit.getLogger().info("[ParkourTopTen] Failed to check for update on Spigot.");
}
return "error";
}
Expand Down

0 comments on commit 12ca10a

Please sign in to comment.