diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java index 826b00c9..4d8885b2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/texture/RequestTextureProvider.java @@ -29,7 +29,7 @@ public RequestTextureProvider(String skinURL, String cloakURL) { private static Texture getTexture(String url, boolean cloak) throws IOException { try { - return new Texture(url, cloak); + return new Texture(url, cloak, null); } catch (FileNotFoundException ignored) { return null; // Simply not found } @@ -37,7 +37,7 @@ private static Texture getTexture(String url, boolean cloak) throws IOException private static Texture getTexture(String url, Path local, boolean cloak) throws IOException { try { - return new Texture(url, local, cloak); + return new Texture(url, local, cloak, null); } catch (FileNotFoundException ignored) { return null; // Simply not found } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java index 83ae980f..2b8d26bc 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/Texture.java @@ -24,7 +24,7 @@ public final class Texture extends StreamObject { public final Map metadata; - public Texture(String url, boolean cloak) throws IOException { + public Texture(String url, boolean cloak, Map metadata) throws IOException { this.url = IOHelper.verifyURL(url); // Fetch texture @@ -38,19 +38,20 @@ public Texture(String url, boolean cloak) throws IOException { // Get digest of texture digest = SecurityHelper.digest(DIGEST_ALGO, new URL(url)); - metadata = null; // May be auto-detect? + this.metadata = metadata; // May be auto-detect? } - public Texture(String url, Path local, boolean cloak) throws IOException { + public Texture(String url, Path local, boolean cloak, Map metadata) throws IOException { this.url = IOHelper.verifyURL(url); try (InputStream input = IOHelper.newInput(local)) { IOHelper.readTexture(input, cloak); // Verify texture } this.digest = SecurityHelper.digest(DIGEST_ALGO, local); - this.metadata = null; + this.metadata = metadata; } + @Deprecated public Texture(String url, byte[] digest) { this.url = IOHelper.verifyURL(url); this.digest = digest == null ? new byte[0] : digest;