Fix username connecting with no texture being overwritten by usercache (#4970)

This commit is contained in:
Camotoy
2021-03-01 16:06:05 -05:00
parent 7bb59f4a28
commit 4299111876
2 changed files with 8 additions and 3 deletions

View File

@@ -179,9 +179,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) {
+ GameProfile profile = userCache.getProfile(this.profile.getId());
+ if (profile != null) {
+ // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't
+ copyProfileProperties(this.profile, profile);
+ this.profile = profile;
+ if (this.profile.getName() == null) {
+ // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't
+ copyProfileProperties(this.profile, profile);
+ this.profile = profile;
+ } else {
+ copyProfileProperties(profile, this.profile);
+ }
+ }
+ }
+ return this.profile.isComplete();