Class EventRegistry

java.lang.Object
dev.despical.whackme.api.EventRegistry

public final class EventRegistry extends Object
Provides read-only discovery helpers for the events exposed by Whack Me.

This class deliberately contains no mutable registration state: the event catalog is defined by EventType, while actual listener registration continues to use Bukkit's standard plugin manager.

API Note: Use this registry when building generic integrations such as event browsers or profilers. Normal listeners should register against the concrete event classes.

  • Method Details

    • getEventClass

      public static Class<? extends org.bukkit.event.Event> getEventClass(EventType type)
      Resolves the concrete Bukkit event class represented by a logical type.
      Parameters:
      type - event type to resolve
      Returns:
      concrete Bukkit event class associated with type
    • matches

      public static boolean matches(EventType type, org.bukkit.event.Event event)
      Tests whether an event instance belongs to the supplied logical type. Subclasses are accepted through Class.isInstance(Object).
      Parameters:
      type - expected logical event type
      event - event instance to test
      Returns:
      true when the event is compatible with the mapped class
    • getRegisteredTypes

      public static Set<EventType> getRegisteredTypes()
      Returns a fresh set containing every event type exposed by the API.
      Returns:
      all currently registered logical event types