Package dev.boze.api

Class BozeInstance

java.lang.Object
dev.boze.api.BozeInstance

public final class BozeInstance extends Object
Boze (API) Instance This class keeps track of all the addons and modules registered by addons It also provides addons a way to register packages and subscribe to events
  • Field Details

    • INSTANCE

      public static final BozeInstance INSTANCE
      The instance of Boze API
  • Method Details

    • registerAddon

      public void registerAddon(Addon addon) throws AddonInitializationException
      Register an addon
      Parameters:
      addon - The addon to register
      Throws:
      AddonInitializationException - If the addon fails to initialize
    • getAddons

      public ArrayList<Addon> getAddons()
      Get all registered addons
      Returns:
      map of all registered addon metadata and addons
    • getModules

      public List<ToggleableModule> getModules()
      Gets a list of all modules registered by addons
      Returns:
      A list of all modules registered by addons
    • getDispatchers

      public List<AddonDispatcher> getDispatchers()
      Gets a list of all addon dispatchers
      Returns:
      A list of all addon dispatchers
    • registerPackage

      public void registerPackage(String pkg)
      Registers a (java) package into the event bus
      Parameters:
      pkg - The package to register
    • subscribe

      public void subscribe(Object listener)
      Subscribes an object to listen to events
      Parameters:
      listener - The object to subscribe
    • subscribe

      public void subscribe(Class<?> listener)
      Subscribes a class to listen to events
      Parameters:
      listener - The class to subscribe
    • unsubscribe

      public void unsubscribe(Object listener)
      Unsubscribes an object to listen to events
      Parameters:
      listener - The object to unsubscribe
    • unsubscribe

      public void unsubscribe(Class<?> listener)
      Unsubscribes a class to listen to events
      Parameters:
      listener - The class to unsubscribe
    • post

      public void post(Object event)
      Post an event
      Parameters:
      event - The event to post