Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
Loading