Use new toString instead of old deprecated one

Unsure if this should be UTF-8
This commit is contained in:
Ossian Winter 2021-01-27 15:41:41 +01:00
parent 2269d8ec9a
commit 64eeba7cf6
No known key found for this signature in database
GPG Key ID: 1017BE95C68A39F9
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import org.json.simple.parser.ParseException;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.logging.Level;
@ -33,7 +34,7 @@ public final class APIManager {
final String url = "https://api.mojang.com/user/profiles/" + uuid + "/names";
try {
final String nameJson = IOUtils.toString(new URL(url));
final String nameJson = IOUtils.toString(new URL(url), StandardCharsets.UTF_8);
if (nameJson != null && nameJson.length() > 0) {
final JSONArray jsonArray = (JSONArray) JSONValue.parseWithException(nameJson);
if (jsonArray != null) {