Package net.draycia.carbon.api.channels
Interface ChatChannel
- All Superinterfaces:
ChatComponentRenderer,Keyed
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public interface ChatChannel
extends Keyed, ChatComponentRenderer
ChatChannel interface, supplies a formatter and filters recipients.
Extends Keyed for identification purposes.
Extends Keyed for identification purposes.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionAlternative command names for this channel.The text that can be used to refer to this channel in commands.longcooldown()The time in milliseconds between player messages.booleanIf the empty receipt message should be sent to the sender.Returns the permissions handler for the channel.longplayerCooldown(CarbonPlayer player) The epoch time (millis) when the player's cooldown expires.Messages will be sent in this channel if they start with this prefix.doubleradius()The distance from the sender players must be to receive chat messages.
Return of '0' means players must be in the same world/server.
Return of '-1' means there is no radius.recipients(CarbonPlayer sender) Returns a list of all recipients that will receive messages from the sender.booleanWhether messages from this channel should be broadcast and sent to other servers.booleanIf commands should be registered for this channel.longstartCooldown(CarbonPlayer player) Starts the cooldown timer for the specified player.Methods inherited from interface net.draycia.carbon.api.util.ChatComponentRenderer
render
-
Method Details
-
permissions
ChannelPermissions permissions()Returns the permissions handler for the channel.- Returns:
- the permissions handler
- Since:
- 3.0.0
-
recipients
Returns a list of all recipients that will receive messages from the sender.- Parameters:
sender- the sender of messages- Returns:
- the recipients
- Since:
- 2.0.0
-
quickPrefix
Messages will be sent in this channel if they start with this prefix.- Returns:
- the message prefix that sends messages in this channel
- Since:
- 2.0.0
-
shouldRegisterCommands
boolean shouldRegisterCommands()If commands should be registered for this channel.- Returns:
- if commands should be registered for this channel.
- Since:
- 2.0.0
-
commandName
String commandName()The text that can be used to refer to this channel in commands.- Returns:
- this channel's name when used in commands
- Since:
- 2.0.0
-
commandAliases
Alternative command names for this channel.- Returns:
- alternative command names
- Since:
- 2.0.0
-
radius
double radius()The distance from the sender players must be to receive chat messages.
Return of '0' means players must be in the same world/server.
Return of '-1' means there is no radius.- Returns:
- the channel radius
- Since:
- 3.0.0
-
emptyRadiusRecipientsMessage
boolean emptyRadiusRecipientsMessage()If the empty receipt message should be sent to the sender.- Returns:
- Returns true if the channel should display a message when a player is out of range.
- Since:
- 3.0.0
-
cooldown
long cooldown()The time in milliseconds between player messages. -1 and 0 disable the cooldown for this channel.- Returns:
- The message cooldown in millis.
- Since:
- 3.0.0
-
playerCooldown
The epoch time (millis) when the player's cooldown expires.- Parameters:
player- The player- Returns:
- The epoch time (millis) when the player's cooldown expires.
- Since:
- 3.0.0
-
startCooldown
Starts the cooldown timer for the specified player. Duration will be the channel cooldown. Returns the player's old cooldown time, if they have one.- Parameters:
player- The player- Returns:
- The player's old cooldown, or 0 if they don't have one.
- Since:
- 3.0.0
-
shouldCrossServer
boolean shouldCrossServer()Whether messages from this channel should be broadcast and sent to other servers.- Returns:
- if this channel's messages should be sent cross-server
- Since:
- 3.0.0
-