aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0848-Add-whitelist-events.patch
diff options
context:
space:
mode:
authorJakub Zacek <[email protected]>2024-07-15 23:35:51 +0200
committerGitHub <[email protected]>2024-07-15 17:35:51 -0400
commit2cd8c461af74f0a524878dcdffba86cd105c48c6 (patch)
treeac107a76fe3d6cdd2e6ef5804ef3cba152957e4c /patches/server/0848-Add-whitelist-events.patch
parentb57b24d549c65ddc5eb3edcc1ecc6aad2826dbd8 (diff)
downloadPaper-2cd8c461af74f0a524878dcdffba86cd105c48c6.tar.gz
Paper-2cd8c461af74f0a524878dcdffba86cd105c48c6.zip
Add OMINOUS_ITEM_SPAWNER SpawnReason (#10897)
Diffstat (limited to 'patches/server/0848-Add-whitelist-events.patch')
-rw-r--r--patches/server/0848-Add-whitelist-events.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/patches/server/0848-Add-whitelist-events.patch b/patches/server/0848-Add-whitelist-events.patch
new file mode 100644
index 0000000000..96884032fb
--- /dev/null
+++ b/patches/server/0848-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 3226a3b69453fb5e13003e941ccbc2d941e047b0..aaa3d5769e0e184e19d01109a76a65be634f830d 100644
+--- a/src/main/java/net/minecraft/server/players/UserWhiteList.java
++++ b/src/main/java/net/minecraft/server/players/UserWhiteList.java
+@@ -28,4 +28,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
+ }