Skip to content

Commit

Permalink
chore/fix: use URI#toURL instead of deprecated URL constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
CamperSamu committed Sep 12, 2024
1 parent d4aa513 commit 682676d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 682676d

Please sign in to comment.