|
22 | 22 | import java.lang.reflect.Field; |
23 | 23 | import java.lang.reflect.Method; |
24 | 24 | import java.net.URL; |
| 25 | +import java.nio.charset.StandardCharsets; |
25 | 26 | import java.util.*; |
26 | 27 | import java.util.concurrent.ConcurrentHashMap; |
27 | 28 | import java.util.regex.Pattern; |
@@ -212,7 +213,7 @@ public void setSkullByURL(SkullMeta meta, URL url) { |
212 | 213 | @Override |
213 | 214 | public void setSkullByBase64(SkullMeta meta, byte[] base64) { |
214 | 215 | GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ""); |
215 | | - gameProfile.getProperties().put("textures", new Property("textures", Base64.getEncoder().encodeToString(base64))); |
| 216 | + gameProfile.getProperties().put("textures", new Property("textures", new String(base64, StandardCharsets.UTF_8))); |
216 | 217 | setSkullByGameProfile(meta, gameProfile); |
217 | 218 | } |
218 | 219 |
|
@@ -270,7 +271,7 @@ public void setSkullByURL(SkullMeta meta, URL url) { |
270 | 271 | @Override |
271 | 272 | public void setSkullByBase64(SkullMeta meta, byte[] base64) { |
272 | 273 | try { |
273 | | - String decoded = new String(Base64.getDecoder().decode(base64)); |
| 274 | + String decoded = new String(base64, StandardCharsets.UTF_8); |
274 | 275 | JsonObject json = new Gson().fromJson(decoded, JsonObject.class); |
275 | 276 | String url = json.getAsJsonObject("textures").getAsJsonObject("SKIN").get("url").getAsString(); |
276 | 277 | setSkullByURL(meta, url); |
|
0 commit comments