mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Check Profile Cache for PlayerProfile API
This ensures we look up the name for ID only Profiles If the profile is in the UserCache, we can get those details quickly This should avoid some unnecessary round trips. Additionally, handle profiles for offline mode to use offline UUID's
This commit is contained in:
@@ -23,7 +23,7 @@ index 45d3dbde2..ab7933079 100644
|
||||
// Spigot end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
|
||||
index 487fc11f1..924dc63a4 100644
|
||||
index 487fc11f1..4fb17a801 100644
|
||||
--- a/src/main/java/net/minecraft/server/UserCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/UserCache.java
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
@@ -64,6 +64,15 @@ index 487fc11f1..924dc63a4 100644
|
||||
ArrayList arraylist = Lists.newArrayList(this.d.keySet());
|
||||
|
||||
return (String[]) arraylist.toArray(new String[arraylist.size()]);
|
||||
}
|
||||
|
||||
+ @Nullable public GameProfile getProfile(UUID uuid) { return a(uuid); } // Paper - OBFHELPER
|
||||
@Nullable
|
||||
- public GameProfile a(UUID uuid) {
|
||||
+ public synchronized GameProfile a(UUID uuid) { // Paper - synchronize
|
||||
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid);
|
||||
|
||||
return usercache_usercacheentry == null ? null : usercache_usercacheentry.a();
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user