13
0
geforkt von Mirrors/Paper

Add whitelist events

Dieser Commit ist enthalten in:
SageSphinx63920 2023-05-14 12:57:15 +02:00
Ursprung 1b118883f2
Commit 02819929b6

Datei anzeigen

@ -0,0 +1,26 @@
--- a/net/minecraft/server/players/UserWhiteList.java
+++ b/net/minecraft/server/players/UserWhiteList.java
@@ -28,4 +28,23 @@
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
}