Class MessagesConfig
java.lang.Object
nl.mtvehicles.core.infrastructure.models.MTVConfig
nl.mtvehicles.core.infrastructure.dataconfig.MessagesConfig
Methods for message files.
Do not initialise this class directly. Use
Do not initialise this class directly. Use
ConfigModule.messagesConfig instead.-
Field Summary
Fields inherited from class nl.mtvehicles.core.infrastructure.models.MTVConfig
config, configType -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor which gets an appropriate file based on the plugin's language (set in SuperSecretSettings) - do not use this.
UseConfigModule.messagesConfiginstead. -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(String key) Deprecated.getMessage(Message message) Get a message by its key (in plugin's set language).voidsaveNewLanguageFiles(String time) Save new language files (when updating from a lower version)voidsendMessage(org.bukkit.command.CommandSender receiver, String key) Deprecated.This may lead to issues - usesendMessage(CommandSender, Message)instead.voidsendMessage(org.bukkit.command.CommandSender receiver, Message message) Send a message to a player/console by its key (in plugin's set language).booleansetLanguageFile(String languageCode) Set this class to work with the appropriate language fileMethods inherited from class nl.mtvehicles.core.infrastructure.models.MTVConfig
getConfig, getConfiguration, reload, save, saveDefaultConfig, setConfigFile, setFileName
-
Constructor Details
-
MessagesConfig
public MessagesConfig()Default constructor which gets an appropriate file based on the plugin's language (set in SuperSecretSettings) - do not use this.
UseConfigModule.messagesConfiginstead.
-
-
Method Details
-
getMessage
Deprecated.This may lead to issues - usegetMessage(Message)instead.Get a message by its key (in plugin's set language).- Parameters:
key- Key of the message - as String
-
getMessage
Get a message by its key (in plugin's set language).- Parameters:
message- Message (enum)
-
sendMessage
Deprecated.This may lead to issues - usesendMessage(CommandSender, Message)instead.Send a message to a player/console by its key (in plugin's set language).- Parameters:
receiver- Player/Consolekey- Key of the message - as String
-
sendMessage
Send a message to a player/console by its key (in plugin's set language).- Parameters:
receiver- Player/Consolemessage- Message (enum)
-
setLanguageFile
Set this class to work with the appropriate language file- Parameters:
languageCode- 'xx' in 'messages_xx.yml'- Returns:
- True if successful
-
saveNewLanguageFiles
Save new language files (when updating from a lower version)- Parameters:
time- Old messages files will be renamed and will contain this time
-
getMessage(Message)instead.