public class EventHandler extends com.google.common.collect.ForwardingCollection<EventNotifier> implements Events
To access this handler, use this code:
Events handler = Registered.events();
Modifier and Type | Method and Description |
---|---|
static Events |
create()
Creates a new event handler, should only be used internally
|
protected Collection<EventNotifier> |
delegate() |
void |
fire(Event event)
Notifies listeners of the event type of the event to be fired
|
void |
registerListener(Plugin plugin,
Listener listener)
Normally not needed to be used.
|
void |
unregister(Class<? extends Listener> cls)
Removes the listener from the caller queue, preventing it from being invoked
|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRemoveAll, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
@InternalUseOnly public static Events create()
To access this handler, use this code:
Events handler = Registered.events();
public void fire(Event event)
Events
@InternalUseOnly public void registerListener(Plugin plugin, Listener listener)
Events
registerListener
in interface Events
listener
- the listener instance to use to registerpublic void unregister(Class<? extends Listener> cls)
Events
unregister
in interface Events
cls
- the listener class to unregisterprotected Collection<EventNotifier> delegate()
delegate
in class com.google.common.collect.ForwardingCollection<EventNotifier>
Copyright © 2016. All rights reserved.