2023-07-23 06:38:53 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: SageSphinx63920 <sage@sagesphinx63920.dev>
|
|
|
|
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
|
2023-09-22 19:31:02 +02:00
|
|
|
index ccbeed395f018009ec8d549302863a5b7f2d00c1..2e1902ec563db14b353629024df54034ab80cddf 100644
|
2023-07-23 06:38:53 +02:00
|
|
|
--- 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
|
|
|
|
}
|