mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Address deprecated URL instantiation (#4178)
Fixes https://github.com/IntellectualSites/PlotSquared/issues/4166
This commit is contained in:
@ -35,7 +35,7 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.net.URI;
|
||||
|
||||
public class UpdateUtility implements Listener {
|
||||
|
||||
@ -59,8 +59,9 @@ public class UpdateUtility implements Listener {
|
||||
public void updateChecker() {
|
||||
task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> {
|
||||
try {
|
||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(
|
||||
HttpsURLConnection connection = (HttpsURLConnection) URI.create(
|
||||
"https://api.spigotmc.org/simple/0.2/index.php?action=getResource&id=77506")
|
||||
.toURL()
|
||||
.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
JsonObject result = new JsonParser()
|
||||
|
Reference in New Issue
Block a user