Class Feature
java.lang.Object
com.kamikazejam.kamicommon.subsystem.AbstractSubsystem<FeatureConfig, Feature>
com.kamikazejam.kamicommon.subsystem.feature.Feature
- All Implemented Interfaces:
ObservableConfig<KamiConfig>, CoreMethods
This class represents a single feature registered under your
A feature is a subsystem that acts like its own plugin, providing its own functionality and configuration.
Features cannot be disabled or toggled, they are always enabled.
For a subsystem that can be toggled or disabled, see
KamiPlugin plugin.A feature is a subsystem that acts like its own plugin, providing its own functionality and configuration.
Features cannot be disabled or toggled, they are always enabled.
For a subsystem that can be toggled or disabled, see
Module.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull FeatureConfigabstract @NotNull VersionedComponent@NotNull File@NotNull StringThe name of the config file (IN SOURCE CODE) for this Feature.
By default, it is fetched asKamiPlugin.getFeatureYmlPath()/[name]Feature.yml
You can override this method, or editKamiPlugin.getFeatureYmlPath()to change the path resolution.@NotNull FileThe data folder for this feature, located at:
/home/container/plugins/<plugin>/features/<feature>/
If the folder does not exist, it will be created automatically.@NotNull StringThe absolute path to the data folder for this feature, i.e.:
/home/container/plugins/<plugin>/features/<feature>/
This is just the File's absolute path, it does not create the folder if it does not exist.final @NotNull VersionedComponentprotected @NotNull StringThe top-level section of the plugin-level config that holds every subsystem of this kind:"modules"for aModule, read out ofmodules.yml, and"features"for aFeature, read out offeatures.yml.
This is deliberately NOT the on-disk folder name fromMODULES_FOLDER/FEATURES_FOLDER, even though the words currently match.Methods inherited from class AbstractSubsystem
buildMessage, buildMiniMessage, getConfig, getKamiConfig, getMessage, getMiniMessage, getName, getPlugin, getSubsystemConfigKey, getSupplementalConfigResource, getSupplementalConfigResource, handleDisable, handleEnable, initializeConfig, onDisable, onDisableLater, onEnable, registerCommands, registerConfigObserver, registerDisableables, registerListeners, registerReloadHook, registerTasks, reloadConfig, reloadObservableConfig, saveConfig, unregisterCommands, unregisterCommands, unregisterConfigObserver, unregisterConfigObservers, unregisterDisableables, unregisterDisableables, unregisterListeners, unregisterListeners, unregisterTasks, unregisterTasks
-
Field Details
-
FEATURES_FOLDER
- See Also:
-
-
Constructor Details
-
Feature
public Feature()
-
-
Method Details
-
defaultPrefix
- Specified by:
defaultPrefixin classAbstractSubsystem<FeatureConfig, Feature>- Returns:
- The default logging prefix for this subsystem (saved under the KamiPlugin featuresConfig featurePrefix)
-
getConfigFileDestination
- Specified by:
getConfigFileDestinationin classAbstractSubsystem<FeatureConfig, Feature>
-
getConfigResourcePath
The name of the config file (IN SOURCE CODE) for this Feature.
By default, it is fetched asKamiPlugin.getFeatureYmlPath()/[name]Feature.yml
You can override this method, or editKamiPlugin.getFeatureYmlPath()to change the path resolution.- Specified by:
getConfigResourcePathin classAbstractSubsystem<FeatureConfig, Feature>
-
createConfig
- Specified by:
createConfigin classAbstractSubsystem<FeatureConfig, Feature>
-
getSubsystemConfigSection
Description copied from class:AbstractSubsystemThe top-level section of the plugin-level config that holds every subsystem of this kind:"modules"for aModule, read out ofmodules.yml, and"features"for aFeature, read out offeatures.yml.
This is deliberately NOT the on-disk folder name fromMODULES_FOLDER/FEATURES_FOLDER, even though the words currently match. Those name a directory and this names a config key; tying them together would make renaming the directory silently rename everybody's config keys.- Specified by:
getSubsystemConfigSectionin classAbstractSubsystem<FeatureConfig, Feature>- Returns:
- the section name, with no trailing dot
-
getPrefix
- Specified by:
getPrefixin classAbstractSubsystem<FeatureConfig, Feature>- Returns:
- The prefix for this subsystem, as defined in the subsystem config
-
getFeatureDataFolder
The data folder for this feature, located at:
/home/container/plugins/<plugin>/features/<feature>/
If the folder does not exist, it will be created automatically. -
getFeatureDataPath
The absolute path to the data folder for this feature, i.e.:
/home/container/plugins/<plugin>/features/<feature>/
This is just the File's absolute path, it does not create the folder if it does not exist.
-