feat: bump required version to Java 21
This commit is contained in:
parent
81b66b6110
commit
eb23580bc4
3 changed files with 28 additions and 26 deletions
|
@ -13,6 +13,7 @@ import javax.net.ssl.HttpsURLConnection;
|
|||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
@ -103,7 +104,7 @@ public class MojangAPI {
|
|||
|
||||
private JsonObject getRequestToUrl(String parametrizedUrl) throws ExecutionException, InterruptedException {
|
||||
return worker.submit(() -> {
|
||||
final URL url = new URL(parametrizedUrl);
|
||||
final URL url = URI.create(parametrizedUrl).toURL();
|
||||
final HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
||||
con.setDoInput(true);
|
||||
con.setRequestMethod("GET");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue