Interface PlayerSession


public interface PlayerSession
Interface used to encapsulate the data of an nChat player session.

An instance can be obtained through the nChatAPI.getSession(Player) method.

  • Method Details

    • id

      UUID id()
      Returns the UUID of the owner of this player session.
      Since:
      API v2
    • getFocusedChannel

      Optional<PublicChannel> getFocusedChannel()
      Returns the default public channel used for this player (configured by the "/focus" command)
      Since:
      API v2
    • getIgnoredPlayers

      default Collection<UUID> getIgnoredPlayers()
      Returns all players who have been blocked (configured by the "/ignore" command)
      Since:
      API v2
    • getIgnored

      Returns all players who have been blocked (configured by the "/ignore" command)
      Since:
      API v3
    • getLastPrivateChatter

      default Optional<UUID> getLastPrivateChatter()
      Returns the last player who chatted privately with this player (used for the "/reply" command).
      Since:
      API v2
    • getLastPrivateChatterPlayer

      Optional<PlayerNameIdPair> getLastPrivateChatterPlayer()
      Returns the last player who chatted privately with this player (used for the "/reply" command).
      Since:
      API v3
    • getFocusedPrivateChatter

      default Optional<UUID> getFocusedPrivateChatter()
      Returns the player whose conversation is focused (used to send private messages to a specific player without using the "/tell" command)
      Since:
      API v2
    • getFocusedPrivateChatterPlayer

      Optional<PlayerNameIdPair> getFocusedPrivateChatterPlayer()
      Returns the player whose conversation is focused (used to send private messages to a specific player without using the "/tell" command)
      Since:
      API v3
    • isPrivateChannelEnabled

      boolean isPrivateChannelEnabled()
      Returns the current state of tell/reply (private channel).
      Returns:
      true if the tell is enabled.
      Since:
      API v3
    • isPrivateChannelDisabled

      default boolean isPrivateChannelDisabled()
      Returns the current state of tell/reply (private channel).
      Returns:
      true if the tell is disabled.
      Since:
      API v2
    • setFocusedChannel

      void setFocusedChannel(@Nullable PublicChannel channel)
      Defines the default public channel used for this player.
      Parameters:
      channel - the channel to be defined
      Since:
      API v3
    • setIgnoredPlayers

      void setIgnoredPlayers(@Nullable Collection<PlayerNameIdPair> ignoredPlayers)
      Defines all players who have been blocked (configured by the "/ignore" command)
      Parameters:
      ignoredPlayers - the players to be defined
      Since:
      API v3
    • setLastPrivateChatter

      void setLastPrivateChatter(@Nullable PlayerNameIdPair player)
      Defines the last player who chatted privately with this player (used for the "/reply" command).
      Parameters:
      player - the player to be defined
      Since:
      API v3
    • setFocusedPrivateChatter

      void setFocusedPrivateChatter(@Nullable PlayerNameIdPair player)
      Defines the player whose conversation is focused (used to send private messages to a specific player without using the "/tell" command)
      Parameters:
      player - the player to be defined
      Since:
      API v3
    • setPrivateChannelEnabled

      void setPrivateChannelEnabled(boolean value)
      Defines if the private channel is enabled;
      Parameters:
      value - true if the tell should be enabled.
      Since:
      API v3
    • isMentionable

      boolean isMentionable(UUID senderId, Channel channel)
      Checks whether the player (owner of this session) can be mentioned by another player on a specific channel.
      Parameters:
      senderId - The sender who would send the message
      channel - The channel to be used
      Returns:
      true if the mention is allowed by this player.
      Since:
      API v2