org.bukkit.event
Class HandlerList

java.lang.Object
  extended by org.bukkit.event.HandlerList

public class HandlerList
extends Object

A list of event handlers, stored per-event. Based on lahwran's fevents.


Constructor Summary
HandlerList()
          Create a new handler list and initialize using EventPriority The HandlerList is then added to meta-list for use in bakeAll()
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerList

public HandlerList()
Create a new handler list and initialize using EventPriority The HandlerList is then added to meta-list for use in bakeAll()

Method Detail

bakeAll

public static void bakeAll()
Bake all handler lists. Best used just after all normal event registration is complete, ie just after all plugins are loaded if you're using fevents in a plugin system.


unregisterAll

public static void unregisterAll()
Unregister all listeners from all handler lists.


unregisterAll

public static void unregisterAll(Plugin plugin)
Unregister a specific plugin's listeners from all handler lists.

Parameters:
plugin - plugin to unregister

unregisterAll

public static void unregisterAll(Listener listener)
Unregister a specific listener from all handler lists.

Parameters:
listener - listener to unregister

register

public void register(RegisteredListener listener)
Register a new listener in this handler list

Parameters:
listener - listener to register

registerAll

public void registerAll(Collection<RegisteredListener> listeners)
Register a collection of new listeners in this handler list

Parameters:
listeners - listeners to register

unregister

public void unregister(RegisteredListener listener)
Remove a listener from a specific order slot

Parameters:
listener - listener to remove

unregister

public void unregister(Plugin plugin)
Remove a specific plugin's listeners from this handler

Parameters:
plugin - plugin to remove

unregister

public void unregister(Listener listener)
Remove a specific listener from this handler

Parameters:
listener - listener to remove

bake

public void bake()
Bake HashMap and ArrayLists to 2d array - does nothing if not necessary


getRegisteredListeners

public RegisteredListener[] getRegisteredListeners()
Get the baked registered listeners associated with this handler list

Returns:
the array of registered listeners

getRegisteredListeners

public static ArrayList<RegisteredListener> getRegisteredListeners(Plugin plugin)
Get a specific plugin's registered listeners associated with this handler list

Parameters:
plugin - the plugin to get the listeners of
Returns:
the list of registered listeners

getHandlerLists

public static ArrayList<HandlerList> getHandlerLists()
Get a list of all handler lists for every event type

Returns:
the list of all handler lists


Copyright © 2013. All Rights Reserved.