From a8db5274493f3bf6c91c8bc9d4a3618a02ba5500 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 18 Jul 2024 16:50:16 +0200 Subject: Even more cleanup of mcutil patch --- patches/server/0145-ProfileWhitelistVerifyEvent.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'patches/server/0145-ProfileWhitelistVerifyEvent.patch') diff --git a/patches/server/0145-ProfileWhitelistVerifyEvent.patch b/patches/server/0145-ProfileWhitelistVerifyEvent.patch index fc614a6bf3..69af001b9f 100644 --- a/patches/server/0145-ProfileWhitelistVerifyEvent.patch +++ b/patches/server/0145-ProfileWhitelistVerifyEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d5f17d7e3b56ca87ec9070b69265ce098de61f69..fec45c058695e68a907684880c87ccf11827565d 100644 +index d5f17d7e3b56ca87ec9070b69265ce098de61f69..768a5c6ebc4466aae4108a79e1564b2bfc93463a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -624,9 +624,9 @@ public abstract class PlayerList { @@ -21,7 +21,7 @@ index d5f17d7e3b56ca87ec9070b69265ce098de61f69..fec45c058695e68a907684880c87ccf1 } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); -@@ -993,7 +993,23 @@ public abstract class PlayerList { +@@ -993,7 +993,24 @@ public abstract class PlayerList { } public boolean isWhiteListed(GameProfile profile) { @@ -33,7 +33,8 @@ index d5f17d7e3b56ca87ec9070b69265ce098de61f69..fec45c058695e68a907684880c87ccf1 + boolean isOp = this.ops.contains(gameprofile); + boolean isWhitelisted = !this.doWhiteList || isOp || this.whitelist.contains(gameprofile); + final com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent event; -+ event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(io.papermc.paper.util.MCUtil.toBukkit(gameprofile), this.doWhiteList, isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage); ++ ++ event = new com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent(com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile), this.doWhiteList, isWhitelisted, isOp, org.spigotmc.SpigotConfig.whitelistMessage); + event.callEvent(); + if (!event.isWhitelisted()) { + if (loginEvent != null) { -- cgit v1.2.3