Interface EventCallback<T extends SkoiceEvent>

Type Parameters:
T - the type of event this callback handles
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EventCallback<T extends SkoiceEvent>
A functional interface for handling Skoice events.

This interface can be used as an alternative to Consumer when subscribing to events via EventBus.subscribeCallback(Class, EventCallback).

Example usage:

EventCallback<PlayerProximityConnectEvent> callback = event -> {
    UUID playerId = event.getMinecraftId();
    String discordId = event.getDiscordId();
    // Handle the event
};

eventBus.subscribeCallback(PlayerProximityConnectEvent.class, callback);
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(T event)
    Handles the given event.
  • Method Details

    • handle

      void handle(T event)
      Handles the given event.
      Parameters:
      event - the event to handle