Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- shutdown()
- getRegisteredEventClasses()
- getRegisteredEventClassNames()
- getRegistry(String)
- getRegistry(Class)
- getSyncRegistry(Class)
- register(Class, Consumer)
- register(EventPriority, Class, Consumer)
- register(short, Class, Consumer)
- register(Class, KeyType, Consumer)
- register(EventPriority, Class, KeyType, Consumer)
- register(short, Class, KeyType, Consumer)
- registerAsync(Class, Function)
- registerAsync(EventPriority, Class, Function)
- registerAsync(short, Class, Function)
- registerAsync(Class, KeyType, Function)
- registerAsync(EventPriority, Class, KeyType, Function)
- registerAsync(short, Class, KeyType, Function)
- registerGlobal(Class, Consumer)
- registerGlobal(EventPriority, Class, Consumer)
- registerGlobal(short, Class, Consumer)
- registerAsyncGlobal(Class, Function)
- registerAsyncGlobal(EventPriority, Class, Function)
- registerAsyncGlobal(short, Class, Function)
- registerUnhandled(Class, Consumer)
- registerUnhandled(EventPriority, Class, Consumer)
- registerUnhandled(short, Class, Consumer)
- registerAsyncUnhandled(Class, Function)
- registerAsyncUnhandled(EventPriority, Class, Function)
- registerAsyncUnhandled(short, Class, Function)
- dispatchFor(Class, KeyType)
- dispatchForAsync(Class, KeyType)
Class EventBus
java.lang.Object
com.hypixel.hytale.event.EventBus
- All Implemented Interfaces:
IEventBus, IEventRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<KeyType, EventType extends IEvent<KeyType>>
IEventDispatcher<EventType, EventType> dispatchFor(Class<? super EventType> eventClass, KeyType key) Called to get an event dispatcher for the specified event class and key.<KeyType, EventType extends IAsyncEvent<KeyType>>
IEventDispatcher<EventType, CompletableFuture<EventType>> dispatchForAsync(Class<? super EventType> eventClass, KeyType key) Called to get an asynchronous event dispatcher for the specified event class and key.Set<Class<? extends IBaseEvent<?>>> <KeyType, EventType extends IBaseEvent<KeyType>>
EventBusRegistry<KeyType, EventType, ?> getRegistry(Class<? super EventType> eventClass) Called to get the event bus registry for the specified event class.EventBusRegistry<?, ?, ?> getRegistry(String eventName) Called to get the event bus registry for the specified event name.<KeyType, EventType extends IEvent<KeyType>>
EventBusRegistry<KeyType, EventType, ?> getSyncRegistry(Class<? super EventType> eventClass) Called to get the synchronous event bus registry for the specified event class.<EventType extends IBaseEvent<Void>>
EventRegistration<Void, EventType> Called to register an event listener for the given event class, with the given priority and consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> register(short priority, Class<? super EventType> eventClass, KeyType key, Consumer<EventType> consumer) Called to register an event listener for the given event class and key, with the given priority and consumer.<EventType extends IBaseEvent<Void>>
EventRegistration<Void, EventType> register(EventPriority priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register an event listener for the given event class, with the given priority and consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> register(EventPriority priority, Class<? super EventType> eventClass, KeyType key, Consumer<EventType> consumer) Called to register an event listener for the given event class and key, with the given priority and consumer.<EventType extends IBaseEvent<Void>>
EventRegistration<Void, EventType> Called to register an event listener for the given event class, with the given consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> Called to register an event listener for the given event class and key, with the given consumer.<EventType extends IAsyncEvent<Void>>
EventRegistration<Void, EventType> registerAsync(short priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async event listener for the given event class, with the given priority and function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsync(short priority, Class<? super EventType> eventClass, KeyType key, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async event listener for the given event class and key, with the given priority and function.<EventType extends IAsyncEvent<Void>>
EventRegistration<Void, EventType> registerAsync(EventPriority priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async event listener for the given event class, with the given priority and function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsync(EventPriority priority, Class<? super EventType> eventClass, KeyType key, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async event listener for the given event class and key, with the given priority and function.<EventType extends IAsyncEvent<Void>>
EventRegistration<Void, EventType> registerAsync(Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async event listener for the given event class, with the given function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsync(Class<? super EventType> eventClass, KeyType key, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async event listener for the given event class and key, with the given function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncGlobal(short priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register a global async event listener for the given event class, with the given priority and function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncGlobal(EventPriority priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register a global async event listener for the given event class, with the given priority and function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncGlobal(Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register a global async event listener for the given event class, with the given function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncUnhandled(short priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async unhandled event listener for the given event class, with the given priority and function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncUnhandled(EventPriority priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async unhandled event listener for the given event class, with the given priority and function.<KeyType, EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncUnhandled(Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Called to register an async unhandled event listener for the given event class, with the given function.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerGlobal(short priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register a global event listener for the given event class, with the given priority and consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerGlobal(EventPriority priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register a global event listener for the given event class, with the given priority and consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerGlobal(Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register a global event listener for the given event class, with the given consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerUnhandled(short priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register an unhandled event listener for the given event class, with the given priority and consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerUnhandled(EventPriority priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register an unhandled event listener for the given event class, with the given priority and consumer.<KeyType, EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerUnhandled(Class<? super EventType> eventClass, Consumer<EventType> consumer) Called to register an unhandled event listener for the given event class, with the given consumer.voidshutdown()Called to shut down the event bus and all its registries.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IEventBus
dispatch, dispatchAsync, dispatchFor, dispatchForAsync
-
Constructor Details
-
EventBus
public EventBus(boolean timeEvents) Default Constructor for anEventBusinstance.- Parameters:
timeEvents- Whether to time events.
-
-
Method Details
-
shutdown
public void shutdown()Called to shut down the event bus and all its registries. -
getRegisteredEventClasses
- Returns:
- a set of all registered event classes for this event bus.
-
getRegisteredEventClassNames
-
getRegistry
Called to get the event bus registry for the specified event name.- Parameters:
eventName- The event name.- Returns:
- the event bus registry, or
nullif not found.
-
getRegistry
@Nonnull public <KeyType, EventType extends IBaseEvent<KeyType>> EventBusRegistry<KeyType, EventType, ?> getRegistry(@Nonnull Class<? super EventType> eventClass) Called to get the event bus registry for the specified event class.- Type Parameters:
KeyType- The key type filter for this event call.EventType- The event type.- Parameters:
eventClass- The event class.- Returns:
- the event bus registry.
-
getSyncRegistry
@Nonnull public <KeyType, EventType extends IEvent<KeyType>> EventBusRegistry<KeyType, EventType, ?> getSyncRegistry(@Nonnull Class<? super EventType> eventClass) Called to get the synchronous event bus registry for the specified event class.- Type Parameters:
KeyType- The key type filter for this event call.EventType- The event type.- Parameters:
eventClass- The event class.- Returns:
- the event bus registry.
-
register
public <EventType extends IBaseEvent<Void>> EventRegistration<Void, EventType> register(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an event listener for the given event class, with the given consumer.- Specified by:
registerin interfaceIEventRegistry- Type Parameters:
EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
register
public <EventType extends IBaseEvent<Void>> EventRegistration<Void, EventType> register(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an event listener for the given event class, with the given priority and consumer.- Specified by:
registerin interfaceIEventRegistry- Type Parameters:
EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
register
public <EventType extends IBaseEvent<Void>> EventRegistration<Void, EventType> register(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an event listener for the given event class, with the given priority and consumer.- Specified by:
registerin interfaceIEventRegistry- Type Parameters:
EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
register
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> register(@Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an event listener for the given event class and key, with the given consumer.- Specified by:
registerin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.key- The key for the event.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
register
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> register(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an event listener for the given event class and key, with the given priority and consumer.- Specified by:
registerin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.key- The key for the event.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
register
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> register(short priority, @Nonnull Class<? super EventType> eventClass, @Nullable KeyType key, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an event listener for the given event class and key, with the given priority and consumer.- Specified by:
registerin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.key- The key for the event.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsync
public <EventType extends IAsyncEvent<Void>> EventRegistration<Void, EventType> registerAsync(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async event listener for the given event class, with the given function.- Specified by:
registerAsyncin interfaceIEventRegistry- Type Parameters:
EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsync
public <EventType extends IAsyncEvent<Void>> EventRegistration<Void, EventType> registerAsync(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async event listener for the given event class, with the given priority and function.- Specified by:
registerAsyncin interfaceIEventRegistry- Type Parameters:
EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsync
public <EventType extends IAsyncEvent<Void>> EventRegistration<Void, EventType> registerAsync(short priority, Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async event listener for the given event class, with the given priority and function.- Specified by:
registerAsyncin interfaceIEventRegistry- Type Parameters:
EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsync
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsync(@Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async event listener for the given event class and key, with the given function.- Specified by:
registerAsyncin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.key- The key for the event.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsync
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsync(@Nonnull EventPriority priority, Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async event listener for the given event class and key, with the given priority and function.- Specified by:
registerAsyncin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.key- The key for the event.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsync
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsync(short priority, @Nonnull Class<? super EventType> eventClass, @Nullable KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async event listener for the given event class and key, with the given priority and function.- Specified by:
registerAsyncin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.key- The key for the event.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerGlobal
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerGlobal(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register a global event listener for the given event class, with the given consumer.- Specified by:
registerGlobalin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerGlobal
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerGlobal(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register a global event listener for the given event class, with the given priority and consumer.- Specified by:
registerGlobalin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerGlobal
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerGlobal(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register a global event listener for the given event class, with the given priority and consumer.- Specified by:
registerGlobalin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsyncGlobal
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncGlobal(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register a global async event listener for the given event class, with the given function.- Specified by:
registerAsyncGlobalin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsyncGlobal
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncGlobal(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register a global async event listener for the given event class, with the given priority and function.- Specified by:
registerAsyncGlobalin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsyncGlobal
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncGlobal(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register a global async event listener for the given event class, with the given priority and function.- Specified by:
registerAsyncGlobalin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerUnhandled
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerUnhandled(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an unhandled event listener for the given event class, with the given consumer.- Specified by:
registerUnhandledin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerUnhandled
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerUnhandled(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an unhandled event listener for the given event class, with the given priority and consumer.- Specified by:
registerUnhandledin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerUnhandled
public <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerUnhandled(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) Description copied from interface:IEventRegistryCalled to register an unhandled event listener for the given event class, with the given priority and consumer.- Specified by:
registerUnhandledin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.consumer- The consumer to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsyncUnhandled
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncUnhandled(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async unhandled event listener for the given event class, with the given function.- Specified by:
registerAsyncUnhandledin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsyncUnhandled
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncUnhandled(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async unhandled event listener for the given event class, with the given priority and function.- Specified by:
registerAsyncUnhandledin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
registerAsyncUnhandled
public <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncUnhandled(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) Description copied from interface:IEventRegistryCalled to register an async unhandled event listener for the given event class, with the given priority and function.- Specified by:
registerAsyncUnhandledin interfaceIEventRegistry- Type Parameters:
KeyType- The key type.EventType- The type of the event.- Parameters:
priority- The priority of the event listener.eventClass- The event class to register the listener for.function- The function to call when the event is dispatched.- Returns:
- the event registration, or
nullif the registration failed.
-
dispatchFor
@Nonnull public <KeyType, EventType extends IEvent<KeyType>> IEventDispatcher<EventType, EventType> dispatchFor(@Nonnull Class<? super EventType> eventClass, KeyType key) Description copied from interface:IEventBusCalled to get an event dispatcher for the specified event class and key.- Specified by:
dispatchForin interfaceIEventBus- Type Parameters:
KeyType- The key type filter for this event call.EventType- The event type.- Parameters:
eventClass- The event class to get the dispatcher for.key- The key to filter events by.- Returns:
- the event dispatcher.
-
dispatchForAsync
@Nonnull public <KeyType, EventType extends IAsyncEvent<KeyType>> IEventDispatcher<EventType, CompletableFuture<EventType>> dispatchForAsync(@Nonnull Class<? super EventType> eventClass, KeyType key) Description copied from interface:IEventBusCalled to get an asynchronous event dispatcher for the specified event class and key.- Specified by:
dispatchForAsyncin interfaceIEventBus- Type Parameters:
KeyType- The key type filter for this event call.EventType- The event type.- Parameters:
eventClass- The event class to get the dispatcher for.key- The key to filter events by.- Returns:
- the asynchronous event dispatcher.
-