Class EventSubscription<E>

java.lang.Object
net.blueva.arcade.api.events.EventSubscription<E>
Type Parameters:
E - Event type handled by the subscription.

public final class EventSubscription<E> extends Object
Platform-agnostic event registration wrapper.

This is intended for platforms where event registration requires both an event class and a handler reference (e.g. Hytale's EventRegistry).

  • Constructor Details

    • EventSubscription

      public EventSubscription(Class<E> eventClass, Consumer<E> handler)
      Constructs a new event subscription.
      Parameters:
      eventClass - the event class to listen for
      handler - the consumer that will handle the event
      Throws:
      NullPointerException - if eventClass or handler is null
  • Method Details

    • getEventClass

      public Class<E> getEventClass()
      Gets the event class this subscription listens for.
      Returns:
      the event class
    • getHandler

      public Consumer<E> getHandler()
      Gets the handler that processes the event.
      Returns:
      the event handler consumer