Paper/patches/api/0162-Add-WhitelistToggleEvent.patch

55 lines
1.6 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Wed, 13 Mar 2019 20:04:43 +0200
Subject: [PATCH] Add WhitelistToggleEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java b/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..b9a59a28c1dec6c174885892ff40d3caaaf409a4
2021-06-11 14:02:28 +02:00
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java
@@ -0,0 +1,42 @@
2021-06-11 14:02:28 +02:00
+package com.destroystokyo.paper.event.server;
+
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
2024-02-01 10:15:57 +01:00
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
2021-06-11 14:02:28 +02:00
+
+/**
+ * This event is fired when whitelist is toggled
+ *
+ * @author Mark Vainomaa
+ */
+@NullMarked
2021-06-11 14:02:28 +02:00
+public class WhitelistToggleEvent extends Event {
+
2024-02-01 10:15:57 +01:00
+ private static final HandlerList HANDLER_LIST = new HandlerList();
2021-06-11 14:02:28 +02:00
+
2024-02-01 10:15:57 +01:00
+ private final boolean enabled;
+
+ @ApiStatus.Internal
+ public WhitelistToggleEvent(final boolean enabled) {
2021-06-11 14:02:28 +02:00
+ this.enabled = enabled;
+ }
+
+ /**
+ * Gets whether whitelist is going to be enabled or not
+ *
+ * @return Whether whitelist is going to be enabled or not
+ */
+ public boolean isEnabled() {
2024-02-01 10:15:57 +01:00
+ return this.enabled;
2021-06-11 14:02:28 +02:00
+ }
+
+ @Override
+ public HandlerList getHandlers() {
2024-02-01 10:15:57 +01:00
+ return HANDLER_LIST;
2021-06-11 14:02:28 +02:00
+ }
+
+ public static HandlerList getHandlerList() {
2024-02-01 10:15:57 +01:00
+ return HANDLER_LIST;
2021-06-11 14:02:28 +02:00
+ }
+}