Class LauncherModule

java.lang.Object
pro.gravit.launcher.modules.LauncherModule

public abstract class LauncherModule extends Object
  • Field Details

  • Constructor Details

    • LauncherModule

      protected LauncherModule()
    • LauncherModule

      protected LauncherModule(LauncherModuleInfo info)
  • Method Details

    • getModuleInfo

      public final LauncherModuleInfo getModuleInfo()
    • getInitStatus

      public LauncherModule.InitStatus getInitStatus()
    • setInitStatus

      public void setInitStatus(LauncherModule.InitStatus initStatus)
    • setContext

      public final void setContext(LauncherModulesContext context)
      The internal method used by the ModuleManager DO NOT TOUCH
      Parameters:
      context - Private context
    • getCheckStatus

      public final pro.gravit.launcher.LauncherTrustManager.CheckClassResultType getCheckStatus()
    • getCheckResult

      public final pro.gravit.launcher.LauncherTrustManager.CheckClassResult getCheckResult()
    • setCheckResult

      public final void setCheckResult(pro.gravit.launcher.LauncherTrustManager.CheckClassResult result)
      The internal method used by the ModuleManager DO NOT TOUCH
      Parameters:
      result - Check result
    • requireModule

      protected final void requireModule(String name, pro.gravit.utils.Version minVersion)
    • requireModule

      protected final <T extends LauncherModule> T requireModule(Class<? extends T> clazz, pro.gravit.utils.Version minVersion)
    • preInitAction

      public void preInitAction()
      This method is called before initializing all modules and resolving dependencies. You can: - Use to Module Manager - Add custom modules not described in the manifest - Change information about your module or modules you control You can not: - Use your dependencies - Use Launcher, LaunchServer, ServerWrapper API - Change the names of any modules
    • preInit

      public final void preInit()
    • init

      public abstract void init(LauncherInitContext initContext)
      Basic module initialization method You can: - Subscribe to events - Use your dependencies - Use provided initContext - Receive modules and access the module’s internal methods You can not: - Modify module description, dependencies - Add modules - Read configuration
      Parameters:
      initContext - null on module initialization during boot or startup Not null during module initialization while running
    • registerEvent

      protected <T extends LauncherModule.Event> boolean registerEvent(LauncherModule.EventHandler<T> handle, Class<T> tClass)
      Registers an event handler for the current module
      Type Parameters:
      T - event type
      Parameters:
      handle - your event handler
      tClass - event class
      Returns:
      true if adding a handler was successful
    • callEvent

      public final <T extends LauncherModule.Event> void callEvent(T event)
      Call the handler of the current module
      Type Parameters:
      T - event type
      Parameters:
      event - event handled