From e36ffcfb9a5e0c2a376e0151ac48c9ef63def727 Mon Sep 17 00:00:00 2001 From: jkvn Date: Sun, 25 Feb 2024 15:50:08 +0100 Subject: [PATCH] Add unregister methods to EventLib class --- src/main/java/at/jkvn/eventlib/EventLib.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/at/jkvn/eventlib/EventLib.java b/src/main/java/at/jkvn/eventlib/EventLib.java index e5bcb38..610015d 100644 --- a/src/main/java/at/jkvn/eventlib/EventLib.java +++ b/src/main/java/at/jkvn/eventlib/EventLib.java @@ -66,6 +66,14 @@ public static void registerListeners(Listener... allListeners) { listeners.addAll(Arrays.stream(allListeners).toList()); } + public static void unregisterListener(Listener listener) { + listeners.remove(listener); + } + + public static void unregisterListeners(Listener... allListeners) { + listeners.removeAll(Arrays.stream(allListeners).toList()); + } + public static void configure(Configuration configuration) { EventLib.configuration = configuration; }