Interface IEventRegistry

All Known Subinterfaces:
IEventBus
All Known Implementing Classes:
EventBus, EventRegistry

public interface IEventRegistry
The event registry interface for registering event listeners.
  • Method Details

    • register

      @Nullable <EventType extends IBaseEvent<Void>> EventRegistration<Void, EventType> register(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register an event listener for the given event class, with the given consumer.
      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 null if the registration failed.
    • register

      @Nullable <EventType extends IBaseEvent<Void>> EventRegistration<Void, EventType> register(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register an event listener for the given event class, with the given priority and consumer.
      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 null if the registration failed.
    • register

      @Nullable <EventType extends IBaseEvent<Void>> EventRegistration<Void, EventType> register(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register an event listener for the given event class, with the given priority and consumer.
      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 null if the registration failed.
    • register

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> register(@Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer)
      Called to register an event listener for the given event class and key, with the given consumer.
      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 null if the registration failed.
    • register

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> register(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer)
      Called to register an event listener for the given event class and key, with the given priority and consumer.
      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 null if the registration failed.
    • register

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> register(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer)
      Called to register an event listener for the given event class and key, with the given priority and consumer.
      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 null if the registration failed.
    • registerAsync

      @Nullable <EventType extends IAsyncEvent<Void>> EventRegistration<Void, EventType> registerAsync(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function)
      Called to register an async event listener for the given event class, with the given function.
      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 null if the registration failed.
    • registerAsync

      @Nullable <EventType extends IAsyncEvent<Void>> EventRegistration<Void, EventType> registerAsync(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function)
      Called to register an async event listener for the given event class, with the given priority and function.
      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 null if the registration failed.
    • registerAsync

      @Nullable <EventType extends IAsyncEvent<Void>> EventRegistration<Void, EventType> registerAsync(short priority, Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function)
      Called to register an async event listener for the given event class, with the given priority and function.
      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 null if the registration failed.
    • registerAsync

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsync(@Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function)
      Called to register an async event listener for the given event class and key, with the given function.
      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 null if the registration failed.
    • registerAsync

      @Nullable <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)
      Called to register an async event listener for the given event class and key, with the given priority and function.
      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 null if the registration failed.
    • registerAsync

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsync(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull 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.
      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 null if the registration failed.
    • registerGlobal

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerGlobal(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register a global event listener for the given event class, with the given consumer.
      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 null if the registration failed.
    • registerGlobal

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerGlobal(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register a global event listener for the given event class, with the given priority and consumer.
      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 null if the registration failed.
    • registerGlobal

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerGlobal(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register a global event listener for the given event class, with the given priority and consumer.
      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 null if the registration failed.
    • registerAsyncGlobal

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncGlobal(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function)
      Called to register a global async event listener for the given event class, with the given function.
      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 null if the registration failed.
    • registerAsyncGlobal

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncGlobal(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull 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.
      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 null if the registration failed.
    • registerAsyncGlobal

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncGlobal(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull 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.
      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 null if the registration failed.
    • registerUnhandled

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerUnhandled(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register an unhandled event listener for the given event class, with the given consumer.
      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 null if the registration failed.
    • registerUnhandled

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerUnhandled(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register an unhandled event listener for the given event class, with the given priority and consumer.
      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 null if the registration failed.
    • registerUnhandled

      @Nullable <KeyType, EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType, EventType> registerUnhandled(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer)
      Called to register an unhandled event listener for the given event class, with the given priority and consumer.
      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 null if the registration failed.
    • registerAsyncUnhandled

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncUnhandled(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function)
      Called to register an async unhandled event listener for the given event class, with the given function.
      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 null if the registration failed.
    • registerAsyncUnhandled

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncUnhandled(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull 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.
      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 null if the registration failed.
    • registerAsyncUnhandled

      @Nullable <KeyType, EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType, EventType> registerAsyncUnhandled(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull 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.
      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 null if the registration failed.