Package org.spongepowered.api.event
Interface EventManager
-
public interface EventManager
Manages the registration of event listeners and the dispatching of events.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
post(Event event)
Calls anEvent
to all listeners that listen to it.<E extends Event>
EventManagerregisterListener(EventListenerRegistration<E> registration)
Submits a newlistener registration
to this manager.EventManager
registerListeners(org.spongepowered.plugin.PluginContainer plugin, Object obj)
EventManager
unregisterListeners(Object obj)
Un-registers an object from receivingEvent
s.
-
-
-
Method Detail
-
registerListener
<E extends Event> EventManager registerListener(EventListenerRegistration<E> registration)
Submits a newlistener 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)
RegistersEvent
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 instanceobj
- The object- Returns:
- This manager, for fluency
-
unregisterListeners
EventManager unregisterListeners(Object obj)
Un-registers an object from receivingEvent
s.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
-
-