Class LanguageFile
java.lang.Object
me.github.simonplays15.betterbansystem.api.files.BaseConfig
me.github.simonplays15.betterbansystem.api.files.LanguageFile
This class represents a language file.
It extends the BaseConfig class.
-
Constructor Summary
ConstructorsConstructorDescriptionLanguageFile
(String languagePath) Constructs a LanguageFile object by loading the language file from the specified path. -
Method Summary
Modifier and TypeMethodDescriptiongetMessage
(String key) Retrieves a message by its key.getMessage
(String key, @NotNull Map<String, String> placeholders) Retrieves the message with the given key and placeholders.Methods inherited from class me.github.simonplays15.betterbansystem.api.files.BaseConfig
b, contains, get, get, getBoolean, getBoolean, getDouble, getDouble, getInt, getInt, getList, getList, getLong, getLong, getString, getString, getStringList, getStringList, isBoolean, isDouble, isInt, isList, isLong, isString, load, save
-
Constructor Details
-
LanguageFile
Constructs a LanguageFile object by loading the language file from the specified path.- Parameters:
languagePath
- The path of the language file to load.
-
-
Method Details
-
getMessage
Retrieves a message by its key.- Parameters:
key
- the key of the message- Returns:
- the message corresponding to the key, or a default error message if the key is not found
- Throws:
NullPointerException
- if the key is null
-
getMessage
Retrieves the message with the given key and placeholders.- Parameters:
key
- the key of the message to retrieveplaceholders
- the placeholders to replace in the message- Returns:
- the formatted message with translated colors
-