Fix state locking for getTopMRUProfiles & getProfileIfCached

Also add missing last access update in getProfileIfCached
This commit is contained in:
Jason Penilla 2022-03-17 19:44:45 -07:00
commit 57a5d8880e
2 changed files with 39 additions and 4 deletions

View file

@ -609,7 +609,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ @Nullable public GameProfile getProfileIfCached(String name) {
+ GameProfileCache.GameProfileInfo entry = this.profilesByName.get(name.toLowerCase(Locale.ROOT));
+ return entry == null ? null : entry.getProfile();
+ if (entry == null) {
+ return null;
+ }
+ entry.setLastAccess(this.getNextOperation());
+ return entry.getProfile();
+ }
+ // Paper end
+