Interface EventRegistration


public interface EventRegistration
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T extends Event>
    void
    registerEvent(Class<T> eventClass, Consumer<T> onPacket)
    Registers an event.
    <T extends Event>
    void
    registerEvent(Class<T> eventClass, Consumer<T> onPacket, int priority)
    Registers an event.
  • Method Details

    • registerEvent

      <T extends Event> void registerEvent(Class<T> eventClass, Consumer<T> onPacket, int priority)
      Registers an event.
      Type Parameters:
      T - the event type
      Parameters:
      eventClass - the class of the event you want to receive
      onPacket - the consumer that is called when the event was dispatched
      priority - the event priority - Higher values mean a higher priority
    • registerEvent

      default <T extends Event> void registerEvent(Class<T> eventClass, Consumer<T> onPacket)
      Registers an event.
      Type Parameters:
      T - the event type
      Parameters:
      eventClass - the class of the event you want to receive
      onPacket - the consumer that is called when the event was dispatched