@@ -17,28 +17,9 @@ public class UpdateUtils {
1717 // -------------------------------------------------- //
1818
1919
20- public static String getLatestPublicVersionTag () {
21- return getLatestVersionTag (false );
22- }
23-
24-
25- @ Deprecated
26- public static String getLatestReleaseVersionTag () {
27- return getLatestVersionTag (true );
28- }
29-
20+ public static String getLatestVersionTag () {
3021
31- // -------------------------------------------------- //
32-
33-
34- private static String getLatestVersionTag (boolean allowPreReleases ) {
35-
36- String API_URL ;
37- if (allowPreReleases ) {
38- API_URL = "https://api.github.com/repos/SniperTVmc/EssentialsX-GUI/releases" ;
39- } else {
40- API_URL = "https://api.github.com/repos/SniperTVmc/EssentialsX-GUI/releases/latest" ;
41- }
22+ String API_URL = "https://api.github.com/repos/SniperTVmc/EssentialsX-GUI/releases/latest" ;
4223
4324 HttpClient client = HttpClient .newHttpClient ();
4425 HttpRequest request = HttpRequest .newBuilder ()
@@ -52,9 +33,8 @@ private static String getLatestVersionTag(boolean allowPreReleases) {
5233 if (response .statusCode () == 200 ) {
5334
5435 ObjectMapper mapper = new ObjectMapper ();
55- JsonNode root = mapper .readTree (response .body ());
56- JsonNode latestRelease = root .get (0 );
57- return latestRelease .get ("tag_name" ).asText ();
36+ JsonNode jsonNode = mapper .readTree (response .body ());
37+ return jsonNode .get ("tag_name" ).asText ();
5838 }
5939
6040 } catch (IOException | InterruptedException e ) {
0 commit comments