Class AbstractEventBus<P>

java.lang.Object
me.lucko.luckperms.common.event.AbstractEventBus<P>
All Implemented Interfaces:
AutoCloseable, net.luckperms.api.event.EventBus

public abstract class AbstractEventBus<P> extends Object implements net.luckperms.api.event.EventBus, AutoCloseable
  • Constructor Details

  • Method Details

    • getPlugin

      public LuckPermsPlugin getPlugin()
    • getApiProvider

      public LuckPermsApiProvider getApiProvider()
    • checkPlugin

      protected abstract P checkPlugin(Object plugin) throws IllegalArgumentException
      Checks that the given plugin object is a valid plugin instance for the platform
      Parameters:
      plugin - the object
      Returns:
      a plugin
      Throws:
      IllegalArgumentException - if the plugin is invalid
    • post

      public void post(net.luckperms.api.event.LuckPermsEvent event)
    • shouldPost

      public boolean shouldPost(Class<? extends net.luckperms.api.event.LuckPermsEvent> eventClass)
    • subscribe

      public void subscribe(LuckPermsEventListener listener)
    • subscribe

      public <T extends net.luckperms.api.event.LuckPermsEvent> @NonNull net.luckperms.api.event.EventSubscription<T> subscribe(@NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler)
      Specified by:
      subscribe in interface net.luckperms.api.event.EventBus
    • subscribe

      public <T extends net.luckperms.api.event.LuckPermsEvent> @NonNull net.luckperms.api.event.EventSubscription<T> subscribe(Object plugin, @NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler)
      Specified by:
      subscribe in interface net.luckperms.api.event.EventBus
    • getSubscriptions

      public <T extends net.luckperms.api.event.LuckPermsEvent> @NonNull Set<net.luckperms.api.event.EventSubscription<T>> getSubscriptions(@NonNull Class<T> eventClass)
      Specified by:
      getSubscriptions in interface net.luckperms.api.event.EventBus
    • unregisterHandler

      public void unregisterHandler(LuckPermsEventSubscription<?> handler)
      Removes a specific handler from the bus
      Parameters:
      handler - the handler to remove
    • unregisterHandlers

      protected void unregisterHandlers(P plugin)
      Removes all handlers for a specific plugin
      Parameters:
      plugin - the plugin
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable