From 682676d6acf29363e03a7900c14dcb0d97d5925c Mon Sep 17 00:00:00 2001 From: Camper_Samu Date: Thu, 12 Sep 2024 17:58:30 +0200 Subject: [PATCH] chore/fix: use URI#toURL instead of deprecated URL constructor --- .../com/campersamu/chatheads/mixin/DownloadHeadOnJoin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/campersamu/chatheads/mixin/DownloadHeadOnJoin.java b/src/main/java/com/campersamu/chatheads/mixin/DownloadHeadOnJoin.java index 433a261..bd1e889 100644 --- a/src/main/java/com/campersamu/chatheads/mixin/DownloadHeadOnJoin.java +++ b/src/main/java/com/campersamu/chatheads/mixin/DownloadHeadOnJoin.java @@ -18,7 +18,7 @@ import javax.imageio.ImageIO; import java.awt.image.BufferedImage; -import java.net.URL; +import java.net.URI; import static com.campersamu.chatheads.ChatHeadsInit.DEFAULT_HEAD_TEXTURE; import static com.campersamu.chatheads.ChatHeadsInit.HEAD_CACHE; @@ -63,7 +63,7 @@ public abstract class DownloadHeadOnJoin { //pull the picture final BufferedImage image; try { - image = ImageIO.read(new URL(playerSkinUrl)); + image = ImageIO.read(URI.create(playerSkinUrl).toURL()); } catch (Exception e) { LOGGER.warn("Failed to get image for {}", player.getName().getString()); LOGGER.warn(e.toString());