testserver/Spigot-Server-Patches/0351-Call-WhitelistToggleEv...

19 lines
819 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Wed, 13 Mar 2019 20:08:09 +0200
Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 88373b1081e69e8f81947682b68c40869b962b15..68ec2ef427bee5940c62b61964b5436e6ef425f6 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1026,6 +1026,7 @@ public abstract class PlayerList {
}
public void setHasWhitelist(boolean flag) {
+ new com.destroystokyo.paper.event.server.WhitelistToggleEvent(flag).callEvent();
this.whitelist.setEnabled(flag); // Paper
}