diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java index 67cd5a7acd..4e2ab0f1b6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/MetricsService.java @@ -29,10 +29,10 @@ import com.google.gson.JsonElement; import com.google.gson.JsonParseException; -import com.google.gson.JsonParser; import io.github.bakedlibs.dough.common.CommonPatterns; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.JsonUtils; /** * This Class represents a Metrics Service that sends data to https://bstats.org/ @@ -204,7 +204,7 @@ private int getLatestVersion() { return -1; } - JsonElement element = JsonParser.parseString(response.body()); + JsonElement element = JsonUtils.parseString(response.body()); return element.getAsJsonObject().get("tag_name").getAsInt(); } catch (IOException | InterruptedException | JsonParseException e) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java index 3d6a711b9e..ccb5898212 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/github/GitHubConnector.java @@ -24,6 +24,7 @@ import com.google.gson.JsonParser; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.JsonUtils; /** * The {@link GitHubConnector} is used to connect to the GitHub API service. @@ -120,7 +121,7 @@ void download() { HttpRequest.newBuilder(uri).header("User-Agent", USER_AGENT).build(), HttpResponse.BodyHandlers.ofString() ); - JsonElement element = JsonParser.parseString(response.body()); + JsonElement element = JsonUtils.parseString(response.body()); if (response.statusCode() >= 200 && response.statusCode() < 300) { onSuccess(element);