Interface ChatChannel

All Known Implementing Classes:
GroupChatChannel, PrivateChatChannel, SimpleChatChannel

public interface ChatChannel
Represents a chat channel that players can join, leave, and communicate in.

Channels are registered via SocialRegistries.Channels. Use builder(String, ChatFormatBuilder) to construct new instances.

  • Method Details

    • builder

      Creates a new ChatChannel builder.
      Parameters:
      name - the unique identifier name for the channel
      formatBuilder - the format builder that defines the channel prefix
      Returns:
      a new builder instance
    • name

      Returns the unique name that identifies this channel.
    • alias

      Returns the mutable alias for this channel, if any.
    • aliasOrName

      default String aliasOrName()
      Returns the alias if one is present, otherwise the channel name().
      Returns:
      alias or name
    • commands

      Returns the slash commands that switch a player into this channel.
    • icon

      Returns the icon component shown in menus for this channel.
    • description

      @NotNull @NotNull Component description()
      Returns a short description of this channel shown in menus.
    • color

      Returns the primary colour associated with this channel.
    • permission

      Returns the permission node required to see or write in this channel, if any.
    • textColor

      Returns an optional override colour applied to message text in this channel.
    • joinByDefault

      boolean joinByDefault()
      Returns true if players are automatically added to this channel on join.
    • supportedRendererFeatures

      @NotNull @NotNull Iterable<ChatRendererFeature> supportedRendererFeatures()
      Returns the renderer features that are active in this channel (e.g. replies, reactions).
    • prefix

      Builds the rendered prefix shown before each message in this channel.
      Parameters:
      user - the message sender
      message - the registered message context
      parser - the parser context used for placeholder resolution
      Returns:
      the rendered prefix component
    • addMember

      boolean addMember(@NotNull @NotNull UUID uuid)
      Adds the player with the given UUID to this channel.
      Parameters:
      uuid - the player's UUID
      Returns:
      true if the player was not already a member
    • addMember

      default boolean addMember(@NotNull @NotNull SocialUser user)
      Adds the given user to this channel.
      Parameters:
      user - the user to add
      Returns:
      true if the user was not already a member
    • removeMember

      boolean removeMember(@NotNull @NotNull UUID uuid)
      Removes the player with the given UUID from this channel.
      Parameters:
      uuid - the player's UUID
      Returns:
      true if the player was a member
    • removeMember

      default boolean removeMember(@NotNull @NotNull SocialUser user)
      Removes the given user from this channel.
      Parameters:
      user - the user to remove
      Returns:
      true if the user was a member
    • members

      Returns all users currently in this channel.
      Returns:
      the current members
    • isMember

      boolean isMember(@NotNull @NotNull UUID uuid)
      Returns true if the player with the given UUID is a member of this channel.
      Parameters:
      uuid - the player UUID to check
      Returns:
      true if the player is a member
    • isMember

      default boolean isMember(@NotNull @NotNull SocialUser user)
      Returns true if the given user is a member of this channel.
      Parameters:
      user - the user to check
      Returns:
      true if the user is a member