Interface ReplacementModule
- All Superinterfaces:
ModuleLocalization, ModuleSimple
Rewrites configured fragments of a message, turning links and emotes into rich content.
-
Method Summary
Modifier and TypeMethodDescriptionaddTags(MessageContext messageContext) Registers the tags that expand the configured replacements.config()The config section this module reads its settings from.net.kyori.adventure.text.ComponentcreateImageComponent(String link) Renders a remote image as a component, downloading it on the first request.format(MessageContext messageContext) Rewrites the configured fragments of the message.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.Methods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
config
Message.Format.Replacement config()Description copied from interface:ModuleSimpleThe config section this module reads its settings from.- Specified by:
configin interfaceModuleSimple- Returns:
- the settings
-
permission
Permission.Message.Format.Replacement permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
localization
Description copied from interface:ModuleLocalizationThe localization section for a player, picked from their chosen language.- Specified by:
localizationin interfaceModuleLocalization- Parameters:
fPlayer- the player the text is for- Returns:
- the localization settings
-
format
Rewrites the configured fragments of the message.- Parameters:
messageContext- the message being formatted- Returns:
- the formatted context
-
addTags
Registers the tags that expand the configured replacements.- Parameters:
messageContext- the message being formatted- Returns:
- the context with the tags added
-
createImageComponent
Renders a remote image as a component, downloading it on the first request. An image that cannot be downloaded or rendered comes back empty.- Parameters:
link- the image url- Returns:
- the rendered image
-