From 92a18d810cc36f1527a29456a96ebaa3b21f5f02 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 22 Apr 2020 09:57:46 +0100 Subject: [PATCH] Correct usage of Json. I'm dumb and forgot toString doesn't work. Repalce with getAsString --- .../main/java/com/plotsquared/bukkit/listener/PlayerEvents.java | 2 +- .../main/java/com/plotsquared/bukkit/util/UpdateUtility.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java index e0c2ac89d..18f8e18e4 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java @@ -670,7 +670,7 @@ public class PlayerEvents extends PlotListener implements Listener { JsonObject result = (new JsonParser()) .parse(new JsonReader(new InputStreamReader(connection.getInputStream()))) .getAsJsonObject(); - spigotVersion = result.get("current_version").toString(); + spigotVersion = result.get("current_version").getAsString(); } catch (IOException e) { new PlotMessage(Captions.PREFIX + "Unable to check for updates, check console for further information.") diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/UpdateUtility.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/UpdateUtility.java index 949522ef0..42b805142 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/UpdateUtility.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/UpdateUtility.java @@ -60,7 +60,7 @@ public class UpdateUtility implements Listener { JsonObject result = (new JsonParser()) .parse(new JsonReader(new InputStreamReader(connection.getInputStream()))) .getAsJsonObject(); - spigotVersion = result.get("current_version").toString(); + spigotVersion = result.get("current_version").getAsString(); } catch (IOException e) { PlotSquared.log(Captions.PREFIX + "&cUnable to check for updates because: " + e); return;