Class AbstractConfig
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.config.AbstractConfig
- All Implemented Interfaces:
IRestartable, IConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSections(ConfigSection<?>... sections) Adds one or more configuration sections to the configuration.protected voidaddTransformations(org.spongepowered.configurate.transformation.ConfigurationTransformation.VersionedBuilder builder) Adds additional transformations to the configuration.protected booleanbooleanprotected StringGets the header for the configuration file.protected List<ConfigSection<?>> Gets the list of configuration sections.inthashCode()protected abstract intGets the initial version of the configuration file.booleanReturns whether the old configuration file (config.yml) exists.protected final voidparseConfig(boolean silent) Parses the configuration file and applies any necessary transformations.@NonNull StringtoString()Methods inherited from interface IConfig
allowClientLocale, allowRedstone, animationTimeMultiplier, debug, flagMovementFormula, isStructureTypeEnabled, loadChunksForToggle, locale, logLevel, maxBlockSpeed, maxBlocksToMove, maxPowerblockDistance, maxStructureCount, maxStructureSize, powerblockCacheTimeout, priceFormula, primaryCommandName, reloadConfig, skipAnimationsByDefault, specificationTimeoutMethods inherited from interface IRestartable
initialize, shutDown
-
Constructor Details
-
AbstractConfig
-
-
Method Details
-
isOldConfigPresent
public boolean isOldConfigPresent()Description copied from interface:IConfigReturns whether the old configuration file (config.yml) exists.If it does, it means the user has not yet migrated their configuration to the new format (
config.yaml).This value is re-evaluated on each config reload, so it reflects the current state of the file system.
- Specified by:
isOldConfigPresentin interfaceIConfig- Returns:
- True if the old configuration file currently exists.
-
initialVersion
protected abstract int initialVersion()Gets the initial version of the configuration file.- Returns:
- The initial version of the configuration file.
-
parseConfig
protected final void parseConfig(boolean silent) Parses the configuration file and applies any necessary transformations.If the configuration file does not exist, it will be created with default values.
- Parameters:
silent- When true, the method will not log any informational/status messages when parsing the results.
-
getHeader
Gets the header for the configuration file.- Returns:
- The header text for the configuration file.
-
addSections
Adds one or more configuration sections to the configuration.- Parameters:
sections- The configuration sections to add.
-
getSections
Gets the list of configuration sections.- Returns:
- A list of configuration sections.
-
addTransformations
protected void addTransformations(org.spongepowered.configurate.transformation.ConfigurationTransformation.VersionedBuilder builder) Adds additional transformations to the configuration.This method can be overridden by subclasses to add their own transformations.
- Parameters:
builder- The builder to add transformations to.
-
toString
-
equals
-
canEqual
-
hashCode
-
configPath
-