mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-26 09:42:06 -07:00
Prevent profile lookups when unnecessary (#10651)
This commit is contained in:
@@ -248,9 +248,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return complete(textures, GlobalConfiguration.get().proxies.isProxyOnlineMode());
|
||||
+ }
|
||||
+ public boolean complete(boolean textures, boolean onlineMode) {
|
||||
+ if (this.isComplete() && (!textures || hasTextures())) { // Don't do lookup if we already have everything
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ MinecraftServer server = MinecraftServer.getServer();
|
||||
+ boolean isCompleteFromCache = this.completeFromCache(true, onlineMode);
|
||||
+ if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) {
|
||||
+ if (onlineMode && (!isCompleteFromCache || (textures && !hasTextures()))) {
|
||||
+ ProfileResult result = server.getSessionService().fetchProfile(this.getId(), true);
|
||||
+ if (result != null && result.profile() != null) {
|
||||
+ copyProfileProperties(result.profile(), this.profile, true);
|
||||
|
Reference in New Issue
Block a user