Fixed "Not a JSON Array", closes #49
This commit is contained in:
parent
08c26540c6
commit
579b2d7e28
1 changed files with 2 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue