Interface EventManager


public interface EventManager
Manages the registration of event listeners and the dispatching of events.
  • Method Details

    • registerListener

      <E extends Event> EventManager registerListener(EventListenerRegistration<E> registration)
      Submits a new listener registration to this manager.
      Type Parameters:
      E - The event type
      Parameters:
      registration - The registration
      Returns:
      This manager, for fluency
    • registerListeners

      EventManager registerListeners(org.spongepowered.plugin.PluginContainer plugin, Object obj)
      Registers Event methods annotated with @Listener in the specified object.

      This will not include any methods declared in supertypes, but will test for private and package-private listener methods.

      Parameters:
      plugin - The plugin container
      obj - The object
      Returns:
      This manager, for fluency
    • unregisterListeners

      EventManager unregisterListeners(Object obj)
      Un-registers an object from receiving Events.

      If the provided object is a plugin, all events associated with that plugin will be unregistered.

      Parameters:
      obj - The object
      Returns:
      This manager, for fluency
    • post

      boolean post(Event event)
      Calls an Event to all listeners that listen to it.
      Parameters:
      event - The event
      Returns:
      True if cancelled, false if not