Class MTVConfig
java.lang.Object
nl.mtvehicles.core.infrastructure.models.MTVConfig
- Direct Known Subclasses:
DefaultConfig,MessagesConfig,SecretSettingsConfig,VehicleDataConfig,VehiclesConfig
Abstract class for plugin's configuration files
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.bukkit.configuration.file.FileConfigurationConfiguration fileprotected final ConfigTypeType of the configuration file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.configuration.file.FileConfigurationDeprecated.New alternative methods have been created in the 'nl.mtvehicles.core.infrastructure.dataconfig' package.protected org.bukkit.configuration.file.FileConfigurationGet the file configuration (new method, protected - should be only used in config classes)voidreload()Reload configuration file (e.g. if you've just edited it in a text editor)booleansave()Save the newly assigned values to the configuration filevoidSave the default configuration filevoidsetConfigFile(File configFile) Set the configuration filevoidsetFileName(String fileName) Set the name of the configuration file (e.g.
-
Field Details
-
configType
Type of the configuration file -
config
protected org.bukkit.configuration.file.FileConfiguration configConfiguration file
-
-
Constructor Details
-
MTVConfig
Basic setter- Parameters:
configType- Type of the config
-
-
Method Details
-
reload
public void reload()Reload configuration file (e.g. if you've just edited it in a text editor) -
getConfig
Deprecated.New alternative methods have been created in the 'nl.mtvehicles.core.infrastructure.dataconfig' package. Otherwise,getConfiguration()should be used instead.Get the file configuration- Returns:
- Config as FileConfiguration
- See Also:
-
getConfiguration
protected org.bukkit.configuration.file.FileConfiguration getConfiguration()Get the file configuration (new method, protected - should be only used in config classes)- Returns:
- Config as FileConfiguration
-
save
public boolean save()Save the newly assigned values to the configuration file- Returns:
- True if saving was successful
-
saveDefaultConfig
public void saveDefaultConfig()Save the default configuration file -
setFileName
Set the name of the configuration file (e.g. 'messages/messages_en.yml')- Parameters:
fileName- Name of the configuration file
-
setConfigFile
Set the configuration file- Parameters:
configFile- Configuration file
-