mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 07:27:59 +01:00
Check that server skin data is complete.
This commit is contained in:
parent
bb5c99d5c7
commit
2ce811efa6
1 changed files with 10 additions and 3 deletions
|
@ -61,9 +61,16 @@ public final class HDSkinManager {
|
||||||
Property prop = Iterables.getFirst(profile1.getProperties().get("textures"), null);
|
Property prop = Iterables.getFirst(profile1.getProperties().get("textures"), null);
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
JsonObject obj = new Gson().fromJson(new String(Base64.decodeBase64(prop.getValue())), JsonObject.class);
|
JsonObject obj = new Gson().fromJson(new String(Base64.decodeBase64(prop.getValue())), JsonObject.class);
|
||||||
String name = obj.get("profileName").getAsString();
|
String name = null;
|
||||||
UUID uuid = UUIDTypeAdapter.fromString(obj.get("profileId").getAsString());
|
// this should be optional
|
||||||
profile1 = new GameProfile(uuid, name);
|
if (obj.has("profileName")) {
|
||||||
|
name = obj.get("profileName").getAsString();
|
||||||
|
}
|
||||||
|
// this is required
|
||||||
|
if (obj.has("profileId")) {
|
||||||
|
UUID uuid = UUIDTypeAdapter.fromString(obj.get("profileId").getAsString());
|
||||||
|
profile1 = new GameProfile(uuid, name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final GameProfile profile = profile1;
|
final GameProfile profile = profile1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue