Class LauncherModule


  • public abstract class LauncherModule
    extends java.lang.Object
    • Constructor Detail

      • LauncherModule

        protected LauncherModule()
    • Method Detail

      • setContext

        public final void setContext​(LauncherModulesContext context)
        The internal method used by the ModuleManager DO NOT TOUCH
        Parameters:
        context - Private context
      • 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
      • getCheckStatus

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

        public final pro.gravit.launcher.LauncherTrustManager.CheckClassResult getCheckResult()
      • 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
      • 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,
                                                                         java.lang.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