Class Module
java.lang.Object
com.kamikazejam.kamicommon.util.log.LoggerService
com.kamikazejam.kamicommon.subsystem.AbstractSubsystem<ModuleConfig,Module>
com.kamikazejam.kamicommon.subsystem.module.Module
- All Implemented Interfaces:
ObservableConfig
,CoreMethods
This class represents a single module registered under your
A module is a toggleable subsystem that acts like its own plugin, providing its own functionality and configuration.
For a subsystem that cannot be toggled or disabled, see
KamiPlugin
plugin.A module is a toggleable subsystem that acts like its own plugin, providing its own functionality and configuration.
For a subsystem that cannot be toggled or disabled, see
Feature
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull ModuleConfig
abstract @NotNull String
@NotNull File
@NotNull String
The name of the config file (IN SOURCE CODE) for this Module.
By default, it is fetched asKamiPlugin.getModuleYmlPath()
/[name]Module.yml
You can override this method, or editKamiPlugin.getModuleYmlPath()
to change the path resolution.@NotNull File
final @NotNull String
abstract boolean
final boolean
Methods inherited from class com.kamikazejam.kamicommon.subsystem.AbstractSubsystem
buildMessage, getConfig, getKamiConfig, getLoggerName, getMessage, getName, getPlugin, getSupplementalConfigResource, handleDisable, handleEnable, initializeConfig, isDebug, logToConsole, onDisable, onDisableLater, onEnable, registerCommands, registerConfigObserver, registerDisableables, registerListeners, registerReloadHook, registerTasks, reloadConfig, reloadObservableConfig, saveConfig, unregisterCommands, unregisterCommands, unregisterConfigObserver, unregisterConfigObservers, unregisterDisableables, unregisterDisableables, unregisterListeners, unregisterListeners, unregisterTasks, unregisterTasks
-
Field Details
-
MODULES_FOLDER
- See Also:
-
-
Constructor Details
-
Module
public Module()
-
-
Method Details
-
isEnabledByDefault
public abstract boolean isEnabledByDefault()- Returns:
- Whether this module is enabled by default (generally always true, except in specific situations)
-
defaultPrefix
- Specified by:
defaultPrefix
in classAbstractSubsystem<ModuleConfig,
Module> - Returns:
- The default logging prefix for this subsystem (saved under the KamiPlugin modulesConfig modulePrefix)
-
getConfigFileDestination
- Specified by:
getConfigFileDestination
in classAbstractSubsystem<ModuleConfig,
Module>
-
getConfigResourcePath
The name of the config file (IN SOURCE CODE) for this Module.
By default, it is fetched asKamiPlugin.getModuleYmlPath()
/[name]Module.yml
You can override this method, or editKamiPlugin.getModuleYmlPath()
to change the path resolution.- Specified by:
getConfigResourcePath
in classAbstractSubsystem<ModuleConfig,
Module>
-
createConfig
- Specified by:
createConfig
in classAbstractSubsystem<ModuleConfig,
Module>
-
isEnabledInConfig
@Internal public final boolean isEnabledInConfig() -
getPrefix
- Specified by:
getPrefix
in classAbstractSubsystem<ModuleConfig,
Module> - Returns:
- The prefix for this subsystem, as defined in the subsystem config
-
getModuleDataFolder
-