From fcd156a98ea07e36cc9da8f1da557c9e51bb2149 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 28 Jun 2020 09:43:47 +0100
Subject: [PATCH] Fix missing hunk from ProfileWhitelistVerifyEvent (Fixes
 #3645)

---
 Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch      | 5 ++++-
 .../Use-ConcurrentHashMap-in-JsonList.patch                  | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch b/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch
index d9429a8cb8..283d860642 100644
--- a/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch
+++ b/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch
@@ -9,8 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/PlayerList.java
 +++ b/src/main/java/net/minecraft/server/PlayerList.java
 @@ -0,0 +0,0 @@ public abstract class PlayerList {
+ 
+             // return chatmessage;
              if (!gameprofilebanentry.hasExpired()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage)); // Spigot
-         } else if (!this.isWhitelisted(gameprofile)) {
+-        } else if (!this.isWhitelisted(gameprofile)) {
++        } else if (!this.isWhitelisted(gameprofile, event)) { // Paper
              chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted");
 -            event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot
 +            //event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot // Paper - moved to isWhitelisted
diff --git a/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch b/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch
index 7fbff83acb..24eca627b3 100644
--- a/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch
+++ b/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch
@@ -126,7 +126,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 --- a/src/main/java/net/minecraft/server/PlayerList.java
 +++ b/src/main/java/net/minecraft/server/PlayerList.java
 @@ -0,0 +0,0 @@ public abstract class PlayerList {
-         } else if (!this.isWhitelisted(gameprofile)) {
+         } else if (!this.isWhitelisted(gameprofile, event)) { // Paper
              chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted");
              //event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot // Paper - moved to isWhitelisted
 -        } else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) {