diff options
Diffstat (limited to 'patches/server/0893-Add-whitelist-events.patch')
-rw-r--r-- | patches/server/0893-Add-whitelist-events.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/patches/server/0893-Add-whitelist-events.patch b/patches/server/0893-Add-whitelist-events.patch new file mode 100644 index 0000000000..44cddb390d --- /dev/null +++ b/patches/server/0893-Add-whitelist-events.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SageSphinx63920 <[email protected]> +Date: Sun, 14 May 2023 12:57:15 +0200 +Subject: [PATCH] Add whitelist events + + +diff --git a/src/main/java/net/minecraft/server/players/UserWhiteList.java b/src/main/java/net/minecraft/server/players/UserWhiteList.java +index a6c70decad1a496595944a5dd2aeeb387757fef3..37635f58cd78ff50991dde413470004400259c89 100644 +--- a/src/main/java/net/minecraft/server/players/UserWhiteList.java ++++ b/src/main/java/net/minecraft/server/players/UserWhiteList.java +@@ -30,4 +30,23 @@ public class UserWhiteList extends StoredUserList<GameProfile, UserWhiteListEntr + protected String getKeyForUser(GameProfile gameProfile) { + return gameProfile.getId().toString(); + } ++ // Paper start - Add whitelist events ++ @Override ++ public void add(UserWhiteListEntry entry) { ++ if (!new io.papermc.paper.event.server.WhitelistStateUpdateEvent(com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(entry.getUser()), io.papermc.paper.event.server.WhitelistStateUpdateEvent.WhitelistStatus.ADDED).callEvent()) { ++ return; ++ } ++ ++ super.add(entry); ++ } ++ ++ @Override ++ public void remove(GameProfile profile) { ++ if (!new io.papermc.paper.event.server.WhitelistStateUpdateEvent(com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile), io.papermc.paper.event.server.WhitelistStateUpdateEvent.WhitelistStatus.REMOVED).callEvent()) { ++ return; ++ } ++ ++ super.remove(profile); ++ } ++ // Paper end - Add whitelist events + } |