public class HandlerList extends Object
Constructor | Description |
---|---|
HandlerList() |
Create a new handler list and initialize using EventPriority.
|
Modifier and Type | Method | Description |
---|---|---|
void |
bake() |
Bake HashMap and ArrayLists to 2d array - does nothing if not necessary
|
static void |
bakeAll() |
Bake all handler lists.
|
static ArrayList<HandlerList> |
getHandlerLists() |
Get a list of all handler lists for every event type
|
RegisteredListener[] |
getRegisteredListeners() |
Get the baked registered listeners associated with this handler list
|
static ArrayList<RegisteredListener> |
getRegisteredListeners(Plugin plugin) |
Get a specific plugin's registered listeners associated with this
handler list
|
void |
register(RegisteredListener listener) |
Register a new listener in this handler list
|
void |
registerAll(Collection<RegisteredListener> listeners) |
Register a collection of new listeners in this handler list
|
void |
unregister(Listener listener) |
Remove a specific listener from this handler
|
void |
unregister(Plugin plugin) |
Remove a specific plugin's listeners from this handler
|
void |
unregister(RegisteredListener listener) |
Remove a listener from a specific order slot
|
static void |
unregisterAll() |
Unregister all listeners from all handler lists.
|
static void |
unregisterAll(Listener listener) |
Unregister a specific listener from all handler lists.
|
static void |
unregisterAll(Plugin plugin) |
Unregister a specific plugin's listeners from all handler lists.
|
public HandlerList()
The HandlerList is then added to meta-list for use in bakeAll()
public static void bakeAll()
public static void unregisterAll()
public static void unregisterAll(@NotNull Plugin plugin)
plugin
- plugin to unregisterpublic static void unregisterAll(@NotNull Listener listener)
listener
- listener to unregisterpublic void register(@NotNull RegisteredListener listener)
listener
- listener to registerpublic void registerAll(@NotNull Collection<RegisteredListener> listeners)
listeners
- listeners to registerpublic void unregister(@NotNull RegisteredListener listener)
listener
- listener to removepublic void unregister(@NotNull Plugin plugin)
plugin
- plugin to removepublic void unregister(@NotNull Listener listener)
listener
- listener to removepublic void bake()
@NotNull public RegisteredListener[] getRegisteredListeners()
@NotNull public static ArrayList<RegisteredListener> getRegisteredListeners(@NotNull Plugin plugin)
plugin
- the plugin to get the listeners of@NotNull public static ArrayList<HandlerList> getHandlerLists()
Copyright © 2019. All rights reserved.