Class EventBus

java.lang.Object
me.totalfreedom.service.Service
me.totalfreedom.event.EventBus

public class EventBus extends Service
  • Constructor Details

    • EventBus

      public EventBus(Patchwork plugin)
  • Method Details

    • addEvent

      public void addEvent(FEvent event)
    • getEvent

      public <T extends FEvent> T getEvent(Class<T> eventClass)
    • subscribe

      public <T extends FEvent> EventSubscription<T> subscribe(Class<T> eventClass, Callback<T> callback)
    • unsubscribe

      public void unsubscribe(EventSubscription<?> subscription)
    • getCommonsBase

      public Patchwork getCommonsBase()
    • tick

      public void tick()
      Description copied from class: Service
      This method is called every single tick, or at least, every tick interval described by the holding ServiceSubscription. Since this runs every single tick, the body of this method should not have a complexity higher than 5. This includes Cyclomatic, Cognitive, and NPath complexities. If the service is asynchronous, there is a bit more flexibility with the complexity rating, extending to no more than 10. However, it's generally good practice to keep the complexity of ticking services as low as possible to avoid extensive resource consumption.
      Specified by:
      tick in class Service
      See Also: