Class GlobalEventHandler
java.lang.Object
net.minestom.server.event.GlobalEventHandler
Object containing all the global event listeners.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDirectly adds a child node to this node.addListener(EventListener<? extends Event> listener) findChildren(String name, Class<E> eventType) Locates all child nodes with the given name and event type recursively starting at this node.Returns an unmodifiable view of the children in this node.<E extends T>
ListenerHandle<E> Gets the handle of an event type.getName()int<E extends T, H>
EventNode<E> map(H value, EventFilter<E, H> filter) Maps a specific object to a node.voidregister(EventBinding<? extends Event> binding) removeChild(EventNode<? extends Event> child) Directly removes the given child from this node.voidremoveChildren(String name, Class<? extends Event> eventType) Recursively removes children with the given name and type starting at this node.removeListener(EventListener<? extends Event> listener) <E extends T>
voidreplaceChildren(String name, Class<E> eventType, EventNode<E> eventNode) Replaces all children matching the given name and type recursively starting from this node.setPriority(int priority) toString()voidPrevents the node fromEventNode.map(Object, EventFilter)to be called.voidunregister(EventBinding<? extends Event> binding) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EventNode
addListener, call, callCancellable, findChildren, hasListener, removeChildren, replaceChildren
-
Constructor Details
-
GlobalEventHandler
public GlobalEventHandler()
-
-
Method Details
-
getHandle
Description copied from interface:EventNodeGets the handle of an event type. -
findChildren
Description copied from interface:EventNodeLocates all child nodes with the given name and event type recursively starting at this node.- Specified by:
findChildrenin interfaceEventNode<T extends Event>- Parameters:
name- The event node name to filter foreventType- The event node type to filter for- Returns:
- All matching event nodes
-
getChildren
-
replaceChildren
Description copied from interface:EventNodeReplaces all children matching the given name and type recursively starting from this node.Node: The callee may not be replaced by this call.
- Specified by:
replaceChildrenin interfaceEventNode<T extends Event>- Parameters:
name- The event name to filter foreventType- The event node type to filter foreventNode- The replacement node
-
removeChildren
Description copied from interface:EventNodeRecursively removes children with the given name and type starting at this node.- Specified by:
removeChildrenin interfaceEventNode<T extends Event>- Parameters:
name- The node name to filter foreventType- The node type to filter for
-
addChild
-
removeChild
Description copied from interface:EventNodeDirectly removes the given child from this node.- Specified by:
removeChildin interfaceEventNode<T extends Event>- Parameters:
child- The child to remove- Returns:
- this, can be used for chaining
-
addListener
- Specified by:
addListenerin interfaceEventNode<T extends Event>
-
removeListener
- Specified by:
removeListenerin interfaceEventNode<T extends Event>
-
map
Description copied from interface:EventNodeMaps a specific object to a node.Be aware that such structure have huge performance penalty as they will always require a map lookup. Use only at last resort.
-
unmap
-
register
-
unregister
- Specified by:
unregisterin interfaceEventNode<T extends Event>
-
getEventType
- Specified by:
getEventTypein interfaceEventNode<T extends Event>
-
getName
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceEventNode<T extends Event>
-
setPriority
- Specified by:
setPriorityin interfaceEventNode<T extends Event>
-
getParent
-
toString
-