Skip to content

Commit

Permalink
fix: deprecated URL instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Dec 16, 2024
1 parent d7e4dda commit 85c3b7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URL;
import java.util.Collections;
import java.util.Optional;
Expand Down Expand Up @@ -121,7 +122,7 @@ default String getMojangApiPlayerName() {
UUID uuid = this.getReferenceUuid();
String urlString = "https://sessionserver.mojang.com/session/minecraft/profile/" + uuid;
try {
URL url = new URL(urlString);
URL url = URI.create(urlString).toURL();
try (InputStream stream = url.openStream()) {
InputStreamReader reader = new InputStreamReader(stream);
JsonElement jsonElement = JsonParser.parseReader(reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ data class ByteResourcePack(
/**
* Hashes a byte array to a sha1 string.
*/
@Suppress("DEPRECATION")
private fun hashSha1(bytes: ByteArray): String {
return Hashing.sha1().hashBytes(bytes).toString()
}
Expand Down

0 comments on commit 85c3b7d

Please sign in to comment.