public interface EventBus
Used to subscribe (or "listen") to LuckPerms events.
| Modifier and Type | Method and Description |
|---|---|
<T extends LuckPermsEvent> |
getHandlers(@NonNull Class<T> eventClass)
Gets a set of all registered handlers for a given event.
|
<T extends LuckPermsEvent> |
subscribe(@NonNull Class<T> eventClass,
@NonNull Consumer<? super T> handler)
Registers a new subscription to the given event.
|
<T extends LuckPermsEvent> |
subscribe(Object plugin,
@NonNull Class<T> eventClass,
@NonNull Consumer<? super T> handler)
Registers a new subscription to the given event.
|
<T extends LuckPermsEvent> @NonNull EventHandler<T> subscribe(@NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler)
The returned EventHandler instance encapsulates the subscription state. It has
methods which can be used to terminate the subscription, or view stats about the nature of
the subscription.
T - the event classeventClass - the event classhandler - the event handler<T extends LuckPermsEvent> @NonNull EventHandler<T> subscribe(Object plugin, @NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler)
The returned EventHandler instance encapsulates the subscription state. It has
methods which can be used to terminate the subscription, or view stats about the nature of
the subscription.
Unlike subscribe(Class, Consumer), this method accepts an additional parameter
for plugin. This object must be a "plugin" instance on the platform, and is used to
automatically unregister the subscription when the
corresponding plugin is disabled.
T - the event classplugin - a plugin instance to bind the subscription to.eventClass - the event classhandler - the event handler<T extends LuckPermsEvent> @NonNull Set<EventHandler<T>> getHandlers(@NonNull Class<T> eventClass)
T - the event classeventClass - the event to find handlers for