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
Modifier and TypeFieldDescriptionprotected org.bukkit.configuration.file.FileConfiguration
Configuration fileprotected ConfigType
Type of the configuration file -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.configuration.file.FileConfiguration
Deprecated.New alternative methods have been created in the 'nl.mtvehicles.core.infrastructure.dataconfig' package.protected org.bukkit.configuration.file.FileConfiguration
Get the file configuration (new method, protected - should be only used in config classes)void
reload()
Reload configuration file (e.g.boolean
save()
Save the newly assigned values to the configuration filevoid
Save the default configuration filevoid
setConfigFile(File configFile)
Set the configuration filevoid
setFileName(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()
-
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
-