mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Prevent profile lookups when unnecessary (#10651)
This commit is contained in:
parent
548fa24c1e
commit
254ed14dc9
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue