Yaml Message Utility - C00kier/CookiersLib GitHub Wiki
Utility class for retrieving and colorizing messages from YAML (FileConfiguration) files.
Get Colorized Message without default message
Retrieves and colorizes a string message from the config by a given key.
getColorizedMessage(FileConfiguration config, String key)
Parameters:
config
— configuration file to read fromkey
— path to the message string
Returns:
- The
colorized message
- A fallback
error message
("[key] config key not found") if thekey
is not present
Throws:
IllegalStateException
if config isnull
Get Colorized Message with default message
Retrieves and colorizes a string message from the config using a fallback message if the key is not found.
getColorizedMessage(FileConfiguration config, String key, String defaultMessage)
Parameters:
config
— configuration file to read fromkey
— path to the message stringdefaultMessage
— fallback string if the key is missing
Returns:
- The
colorized message
(default or found value)
Throws:
IllegalStateException
if config isnull
Get list of Colorized Messages
Retrieves and colorizes a list of string messages from the config.
getColorizedMessagesFromList(FileConfiguration config, String key)
Parameters:
config
— configuration file to read fromkey
— path to the list of messages
Returns:
List
ofcolorized strings
Throws:
IllegalStateException
if config isnull