From 254ed14dc9c3836037a1287f6ba8cd5ed285aa35 Mon Sep 17 00:00:00 2001 From: Bridge <29434554+bridgelol@users.noreply.github.com> Date: Sun, 5 May 2024 19:07:30 +0200 Subject: [PATCH] Prevent profile lookups when unnecessary (#10651) --- patches/server/Basic-PlayerProfile-API.patch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/patches/server/Basic-PlayerProfile-API.patch b/patches/server/Basic-PlayerProfile-API.patch index 755f546a0c..ac61ad212f 100644 --- a/patches/server/Basic-PlayerProfile-API.patch +++ b/patches/server/Basic-PlayerProfile-API.patch @@ -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);