Interface ChatModule

All Superinterfaces:
ModuleLocalization, ModuleSimple

public interface ChatModule extends ModuleLocalization
Handles ordinary chat, deciding which chat a message goes to, who hears it and how it is formatted.
  • Method Details

    • config

      Message.Chat config()
      Description copied from interface: ModuleSimple
      The config section this module reads its settings from.
      Specified by:
      config in interface ModuleSimple
      Returns:
      the settings
    • permission

      Description copied from interface: ModuleSimple
      The permission that gates this module.
      Specified by:
      permission in interface ModuleSimple
      Returns:
      the permission
    • localization

      Localization.Message.Chat localization(FPlayer fPlayer)
      Description copied from interface: ModuleLocalization
      The localization section for a player, picked from their chosen language.
      Specified by:
      localization in interface ModuleLocalization
      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 speaker
      rawString - the text as typed
      cancelEvent - called to suppress the platform's own handling
      successEvent - called with the formatted text and whether the plugin already delivered it
    • sendMessage

      void sendMessage(FPlayer fPlayer, String rawString, String playerMessage, Chat playerChat)
      Delivers a chat message that has already passed the checks.
      Parameters:
      fPlayer - the speaker
      rawString - the text as typed
      playerMessage - the formatted text
      playerChat - the chat it goes to
    • permissionFilter

      Predicate<FPlayer> permissionFilter(String chatName)
      Which players may read a given chat.
      Parameters:
      chatName - the chat
      Returns:
      the reader filter