public class ListenerHandler extends Object
| 构造器和说明 |
|---|
ListenerHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
Plugin |
getPlugin()
Get the plugin of the listener
|
<T extends Event> |
register(Listener listener,
Method method,
EventHandler handler)
Register the listener
|
static void |
register(Plugin plugin,
Listener listener)
Add the listener and bundle to the plugin
|
<T extends Event> |
submit(T event)
Submit the event to this listener handler
|
void |
unregister(Listener listener)
Unregister the listener
|
static void |
unregister(Plugin plugin)
Unregister all listeners bundle to the plugin
|
static boolean |
unregisterAll()
Unregister all listeners
|
public static void unregister(Plugin plugin)
plugin - the plugin which need to unregister all its listenerspublic static void register(Plugin plugin, Listener listener)
plugin - the pluginlistener - the listenerpublic void unregister(Listener listener)
listener - the listener need to be unregisteredpublic static boolean unregisterAll()
public <T extends Event> void register(Listener listener, Method method, EventHandler handler)
T - the event typelistener - the listenermethod - the listener method to this Event listener handlerhandler - the event handlerpublic Plugin getPlugin()
public <T extends Event> void submit(T event)
T - the event typeevent - the event need to be submittedCopyright © 2022. All rights reserved.