Package com.nickuc.chat.api.types
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 Summary
Modifier and TypeMethodDescriptionReturns the default public channel used for this player (configured by the "/focus" command)Returns the player whose conversation is focused (used to send private messages to a specific player without using the "/tell" command)Returns the player whose conversation is focused (used to send private messages to a specific player without using the "/tell" command)Returns all players who have been blocked (configured by the "/ignore" command)default Collection<UUID> Returns all players who have been blocked (configured by the "/ignore" command)Returns the last player who chatted privately with this player (used for the "/reply" command).Returns the last player who chatted privately with this player (used for the "/reply" command).id()Returns the UUID of the owner of this player session.booleanisMentionable(UUID senderId, Channel channel) Checks whether the player (owner of this session) can be mentioned by another player on a specific channel.default booleanReturns the current state of tell/reply (private channel).booleanReturns the current state of tell/reply (private channel).voidsetFocusedChannel(PublicChannel channel) Defines the default public channel used for this player.voidDefines the player whose conversation is focused (used to send private messages to a specific player without using the "/tell" command)voidsetIgnoredPlayers(Collection<PlayerNameIdPair> ignoredPlayers) Defines all players who have been blocked (configured by the "/ignore" command)voidDefines the last player who chatted privately with this player (used for the "/reply" command).voidsetPrivateChannelEnabled(boolean value) Defines if the private channel is enabled;
-
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
Returns all players who have been blocked (configured by the "/ignore" command)- Since:
- API v2
-
getIgnored
Collection<PlayerNameIdPair> getIgnored()Returns all players who have been blocked (configured by the "/ignore" command)- Since:
- API v3
-
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
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
Defines the default public channel used for this player.- Parameters:
channel- the channel to be defined- Since:
- API v3
-
setIgnoredPlayers
Defines all players who have been blocked (configured by the "/ignore" command)- Parameters:
ignoredPlayers- the players to be defined- Since:
- API v3
-
setLastPrivateChatter
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
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
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 messagechannel- The channel to be used- Returns:
- true if the mention is allowed by this player.
- Since:
- API v2
-