Class MessagesConfig

java.lang.Object
nl.mtvehicles.core.infrastructure.models.Config
nl.mtvehicles.core.infrastructure.dataconfig.MessagesConfig

public class MessagesConfig extends Config
Methods for message files.
Do not initialise this class directly. Use ConfigModule.messagesConfig instead.
  • 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.
      Use ConfigModule.messagesConfig instead.
  • Method Details

    • getMessage

      @Deprecated public String getMessage(String key)
      Deprecated.
      This may lead to issues - use getMessage(Message) instead.
      Get a message by its key (in plugin's set language).
      Parameters:
      key - Key of the message - as String
    • getMessage

      public String getMessage(Message message)
      Get a message by its key (in plugin's set language).
      Parameters:
      message - Message (enum)
    • sendMessage

      @Deprecated public void sendMessage(org.bukkit.command.CommandSender receiver, String key)
      Deprecated.
      This may lead to issues - use sendMessage(CommandSender, Message) instead.
      Send a message to a player/console by its key (in plugin's set language).
      Parameters:
      receiver - Player/Console
      key - Key of the message - as String
    • sendMessage

      public void sendMessage(org.bukkit.command.CommandSender receiver, Message message)
      Send a message to a player/console by its key (in plugin's set language).
      Parameters:
      receiver - Player/Console
      message - Message (enum)
    • setLanguageFile

      public boolean setLanguageFile(String languageCode)
      Set this class to work with the appropriate language file
      Parameters:
      languageCode - 'xx' in 'messages_xx.yml'
      Returns:
      True if successful
    • saveNewLanguageFiles

      public void saveNewLanguageFiles(String time)
      Save new language files (when updating from a lower version)
      Parameters:
      time - Old messages files will be renamed and will contain this time