diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java index 3f197446..0323b629 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/LauncherModule.java @@ -24,6 +24,13 @@ public LauncherModuleInfo getModuleInfo() { return moduleInfo; } + + /** + * Module initialization status at the current time + * CREATED - Module status immediately after loading + * INIT - The state of the module during the execution of the method init() + * FINISH - Status of the module after initialization + */ public enum InitStatus { CREATED, @@ -58,6 +65,11 @@ public LauncherModule setInitStatus(InitStatus initStatus) { return this; } + /** + * The internal method used by the ModuleManager + * DO NOT TOUCH + * @param context Private context + */ public void setContext(LauncherModulesContext context) { if(this.context != null) throw new IllegalStateException("Module already set context"); @@ -66,19 +78,56 @@ public void setContext(LauncherModulesContext context) this.modulesConfigManager = context.getModulesConfigManager(); } + /** + * 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 API Launcher, LaunchServer, ServerWrapper + * Change the names of any modules + */ public void preInit() { //NOP } + /** + * 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 + * @param initContext