Fixed same skin among characters in one account

This commit is contained in:
huanghongxun 2018-02-18 15:42:18 +08:00
parent 20a7039f59
commit 44a9470613

View File

@ -300,14 +300,14 @@ public class YggdrasilAccount extends Account {
Property textureProperty; Property textureProperty;
if (getUserProperties().containsKey("textures")) if (profile.getProperties().containsKey("textures"))
textureProperty = getUserProperties().get("textures"); textureProperty = profile.getProperties().get("textures");
else { else {
ProfileResponse response = GSON.fromJson(NetworkUtils.doGet(NetworkUtils.toURL(baseProfile + UUIDTypeAdapter.fromUUID(profile.getId()))), ProfileResponse.class); ProfileResponse response = GSON.fromJson(NetworkUtils.doGet(NetworkUtils.toURL(baseProfile + UUIDTypeAdapter.fromUUID(profile.getId()))), ProfileResponse.class);
if (response.getProperties() == null) return Optional.empty(); if (response.getProperties() == null) return Optional.empty();
textureProperty = response.getProperties().get("textures"); textureProperty = response.getProperties().get("textures");
if (textureProperty == null) return Optional.empty(); if (textureProperty == null) return Optional.empty();
getUserProperties().putAll(response.getProperties()); profile.getProperties().putAll(response.getProperties());
} }
TextureResponse texture; TextureResponse texture;