Package pro.gravit.launcher.modules
Class LauncherModule
java.lang.Object
pro.gravit.launcher.modules.LauncherModule
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic enumModule initialization status at the current time -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LauncherModule.InitStatusprotected final LauncherModuleInfoprotected ModulesConfigManagerprotected LauncherModulesManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends LauncherModule.Event>
voidcallEvent(T event) Call the handler of the current modulefinal pro.gravit.launcher.LauncherTrustManager.CheckClassResultfinal pro.gravit.launcher.LauncherTrustManager.CheckClassResultTypefinal LauncherModuleInfoabstract voidinit(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 configurationfinal voidpreInit()voidThis method is called before initializing all modules and resolving dependencies.protected <T extends LauncherModule.Event>
booleanregisterEvent(LauncherModule.EventHandler<T> handle, Class<T> tClass) Registers an event handler for the current moduleprotected final <T extends LauncherModule>
TrequireModule(Class<? extends T> clazz, pro.gravit.utils.Version minVersion) protected final voidrequireModule(String name, pro.gravit.utils.Version minVersion) final voidsetCheckResult(pro.gravit.launcher.LauncherTrustManager.CheckClassResult result) The internal method used by the ModuleManager DO NOT TOUCHfinal voidsetContext(LauncherModulesContext context) The internal method used by the ModuleManager DO NOT TOUCHvoidsetInitStatus(LauncherModule.InitStatus initStatus)
-
Field Details
-
moduleInfo
-
modulesManager
-
modulesConfigManager
-
initStatus
-
-
Constructor Details
-
LauncherModule
protected LauncherModule() -
LauncherModule
-
-
Method Details
-
getModuleInfo
-
getInitStatus
-
setInitStatus
-
setContext
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
-
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
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 handlertClass- event class- Returns:
- true if adding a handler was successful
-
callEvent
Call the handler of the current module- Type Parameters:
T- event type- Parameters:
event- event handled
-