Interface EventManager


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

      • registerListeners

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

        Only methods that are public will be registered and the class must be public as well.

        Parameters:
        plugin - The plugin instance
        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