mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Add whitelist events
This commit is contained in:
parent
1b118883f2
commit
02819929b6
1 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue