Interface ChatModule
- All Superinterfaces:
ModuleLocalization, ModuleSimple
Handles ordinary chat, deciding which chat a message goes to, who hears it and how it is formatted.
-
Method Summary
Modifier and TypeMethodDescriptionconfig()The config section this module reads its settings from.voidhandleChatEvent(FPlayer fPlayer, String rawString, Runnable cancelEvent, BiConsumer<String, Boolean> successEvent) Handles a chat message from the platform, deciding whether it goes through and where.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.permissionFilter(String chatName) Which players may read a given chat.voidsendMessage(FPlayer fPlayer, String rawString, String playerMessage, Chat playerChat) Delivers a chat message that has already passed the checks.Methods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
config
Message.Chat config()Description copied from interface:ModuleSimpleThe config section this module reads its settings from.- Specified by:
configin interfaceModuleSimple- Returns:
- the settings
-
permission
Permission.Message.Chat 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
-
handleChatEvent
void handleChatEvent(FPlayer fPlayer, String rawString, Runnable cancelEvent, BiConsumer<String, Boolean> successEvent) Handles a chat message from the platform, deciding whether it goes through and where.- Parameters:
fPlayer- the speakerrawString- the text as typedcancelEvent- called to suppress the platform's own handlingsuccessEvent- called with the formatted text and whether the plugin already delivered it
-
sendMessage
-
permissionFilter
-