public interface EventBus
Used to subscribe (or "listen") to LuckPerms events.
| Modifier and Type | Method and Description |
|---|---|
<T extends LuckPermsEvent> |
getHandlers(Class<T> eventClass)
Gets a set of all registered handlers for a given event.
|
<T extends LuckPermsEvent> |
subscribe(Class<T> eventClass,
Consumer<? super T> handler)
Registers a new subscription to the given event.
|
<T extends LuckPermsEvent> |
subscribe(Object plugin,
Class<T> eventClass,
Consumer<? super T> handler)
Registers a new subscription to the given event.
|
@Nonnull <T extends LuckPermsEvent> 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@Nonnull <T extends LuckPermsEvent> 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@Nonnull <T extends LuckPermsEvent> Set<EventHandler<T>> getHandlers(@Nonnull Class<T> eventClass)
T - the event classeventClass - the event to find handlers forCopyright © 2018. All rights reserved.