From 579b2d7e2845105dc3d923d220f4245bfd68119e Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Sun, 5 Jul 2020 21:31:34 +0200 Subject: [PATCH] Fixed "Not a JSON Array", closes #49 --- .../nl/SBDeveloper/V10Lift/sbutils/UpdateManager.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/sbutils/UpdateManager.java b/src/main/lombok/nl/SBDeveloper/V10Lift/sbutils/UpdateManager.java index e63ca9d..8445778 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/sbutils/UpdateManager.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/sbutils/UpdateManager.java @@ -1,6 +1,5 @@ package nl.SBDeveloper.V10Lift.sbutils; -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import org.bukkit.Bukkit; @@ -104,13 +103,10 @@ public class UpdateManager { } in.close(); - JsonParser parser = new JsonParser(); - if (type == CheckType.SPIGOT) { - JsonArray array = parser.parse(response.toString()).getAsJsonArray(); - - version = array.get(0).getAsJsonObject().get("name").getAsString(); + version = response.toString(); } else if (type == CheckType.SBDPLUGINS) { + JsonParser parser = new JsonParser(); JsonObject object = parser.parse(response.toString()).getAsJsonObject(); version = object.get("data").getAsJsonObject().get("version").getAsString();