From c0a157eb9fd853da248ec25b35f4c7dc3f38147a Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 9 Jun 2022 22:37:26 +0100
Subject: [PATCH] Fix don't lookup profiles for blank names patch

---
 .../Add-setting-for-proxy-online-mode-status.patch       | 4 +++-
 ...-lookup-game-profiles-that-have-no-UUID-and-no-.patch | 9 ++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/patches/server/Add-setting-for-proxy-online-mode-status.patch b/patches/server/Add-setting-for-proxy-online-mode-status.patch
index 5fd9b7c733..77b418d7b5 100644
--- a/patches/server/Add-setting-for-proxy-online-mode-status.patch
+++ b/patches/server/Add-setting-for-proxy-online-mode-status.patch
@@ -13,7 +13,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              }
          };
  
-+        if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
+-        if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
++        if (!org.apache.commons.lang3.StringUtils.isBlank(name) // Paper - Don't lookup a profile with a blank name
++                && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
          repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
          GameProfile gameprofile = (GameProfile) atomicreference.get();
  
diff --git a/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
index 69c0107a46..94026a2455 100644
--- a/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
+++ b/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
@@ -9,11 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
 +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
 @@ -0,0 +0,0 @@ public class GameProfileCache {
+             }
+         };
+ 
++        if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
          repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
          GameProfile gameprofile = (GameProfile) atomicreference.get();
  
--        if (!GameProfileCache.usesAuthentication() && gameprofile == null) {
-+        if (!GameProfileCache.usesAuthentication() && gameprofile == null && !org.apache.commons.lang3.StringUtils.isBlank(name)) { // Paper - Don't lookup a profile with a blank name
-             UUID uuid = UUIDUtil.getOrCreatePlayerUUID(new GameProfile((UUID) null, name));
- 
-             return Optional.of(new GameProfile(uuid, name));