diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/auth/GameProfile.java b/protocol/src/main/java/org/geysermc/mcprotocollib/auth/GameProfile.java index b481a437d..0e68a2aa4 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/auth/GameProfile.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/auth/GameProfile.java @@ -14,7 +14,6 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -371,7 +370,7 @@ public enum TextureType { * The model used for a profile texture. */ public enum TextureModel { - NORMAL, + WIDE, SLIM; } @@ -390,7 +389,7 @@ public static class Texture { */ public Texture(String url, Map metadata) { this.url = url; - this.metadata = new HashMap<>(metadata); + this.metadata = metadata; } /** @@ -408,6 +407,10 @@ public String getURL() { * @return The metadata value corresponding to the given key. */ public String getMetadata(String key) { + if (this.metadata == null) { + return null; + } + return this.metadata.get(key); } @@ -418,7 +421,7 @@ public String getMetadata(String key) { */ public TextureModel getModel() { String model = this.getMetadata("model"); - return model != null && model.equals("slim") ? TextureModel.SLIM : TextureModel.NORMAL; + return model != null && model.equals("slim") ? TextureModel.SLIM : TextureModel.WIDE; } /** diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java b/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java index 8781c69b4..d21e3a51a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java @@ -36,8 +36,11 @@ public static T makeRequest(@Nullable ProxyInfo proxy, URI uri, Object input throw new IllegalArgumentException("URI cannot be null."); } - HttpResponse response = createHttpClient(proxy).execute(input == null ? new HttpRequest("GET", uri.toURL()) : - new HttpContentRequest("POST", uri.toURL()).setContent(HttpContent.string(GSON.toJson(input)))); + HttpResponse response = createHttpClient(proxy) + .execute(input == null ? new HttpRequest("GET", uri.toURL()) : + new HttpContentRequest("POST", uri.toURL()) + .setContent(HttpContent.string(GSON.toJson(input))) + .setHeader(Headers.CONTENT_TYPE, ContentTypes.APPLICATION_JSON.toString())); if (responseType == null) { return null;