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 @NotNull ArrayList<HandlerList> |
getHandlerLists() |
Get a list of all handler lists for every event type
|
@NotNull RegisteredListener[] |
getRegisteredListeners() |
Get the baked registered listeners associated with this handler list
|
static @NotNull ArrayList<RegisteredListener> |
getRegisteredListeners(@NotNull Plugin plugin) |
Get a specific plugin's registered listeners associated with this
handler list
|
void |
register(@NotNull RegisteredListener listener) |
Register a new listener in this handler list
|
void |
registerAll(@NotNull Collection<RegisteredListener> listeners) |
Register a collection of new listeners in this handler list
|
void |
unregister(@NotNull Listener listener) |
Remove a specific listener from this handler
|
void |
unregister(@NotNull Plugin plugin) |
Remove a specific plugin's listeners from this handler
|
void |
unregister(@NotNull RegisteredListener listener) |
Remove a listener from a specific order slot
|
static void |
unregisterAll() |
Unregister all listeners from all handler lists.
|
static void |
unregisterAll(@NotNull Listener listener) |
Unregister a specific listener from all handler lists.
|
static void |
unregisterAll(@NotNull 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 @NotNull Plugin plugin)
plugin
- plugin to unregisterpublic static void unregisterAll(@NotNull @NotNull Listener listener)
listener
- listener to unregisterpublic void register(@NotNull @NotNull RegisteredListener listener)
listener
- listener to registerpublic void registerAll(@NotNull @NotNull Collection<RegisteredListener> listeners)
listeners
- listeners to registerpublic void unregister(@NotNull @NotNull RegisteredListener listener)
listener
- listener to removepublic void unregister(@NotNull @NotNull Plugin plugin)
plugin
- plugin to removepublic void unregister(@NotNull @NotNull Listener listener)
listener
- listener to removepublic void bake()
@NotNull public @NotNull RegisteredListener[] getRegisteredListeners()
@NotNull public static @NotNull ArrayList<RegisteredListener> getRegisteredListeners(@NotNull @NotNull Plugin plugin)
plugin
- the plugin to get the listeners of@NotNull public static @NotNull ArrayList<HandlerList> getHandlerLists()
Copyright © 2020. All rights reserved.