Package net.draycia.carbon.api.channels
Interface ChannelPermissions
public interface ChannelPermissions
Permissions handling for a channel.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleandynamic()Returns whether the result ofjoinPermitted(CarbonPlayer)is dynamic.hearingPermitted(CarbonPlayer player) Checks if the player may receive messages from this channel.joinPermitted(CarbonPlayer carbonPlayer) Checks if the player may join this channel.speechPermitted(CarbonPlayer carbonPlayer) Checks if the player may send messages in this channel.static ChannelPermissionsCreates a newChannelPermissionsthat performs the same check forjoinPermitted(CarbonPlayer),hearingPermitted(CarbonPlayer), andspeechPermitted(CarbonPlayer).
-
Method Details
-
joinPermitted
Checks if the player may join this channel.- Parameters:
carbonPlayer- the player attempting to join- Returns:
- if the player may join
- Since:
- 3.0.0
-
speechPermitted
Checks if the player may send messages in this channel.- Parameters:
carbonPlayer- the player attempting to speak- Returns:
- if the player may speak
- Since:
- 3.0.0
-
hearingPermitted
Checks if the player may receive messages from this channel.- Parameters:
player- the player that's receiving messages- Returns:
- if the player may receive messages
- Since:
- 3.0.0
-
dynamic
boolean dynamic()Returns whether the result ofjoinPermitted(CarbonPlayer)is dynamic.An example of a dynamic permissions is the built-in party channel that only allows players in a party to join.
An example of static permissions is the built-in config channels that simply check permission strings. The fact that a player's permissions may change during gameplay does not make the permission dynamic, as the server will resend commands on permission changes.
If the result is static, then we can avoid sending commands to the player that they will just get denied use of on execute. If it's dynamic, we must send the command regardless in case they gain permission later.
- Returns:
- whether the permissions are dynamic
- Since:
- 3.0.0
-
uniformDynamic
Creates a newChannelPermissionsthat performs the same check forjoinPermitted(CarbonPlayer),hearingPermitted(CarbonPlayer), andspeechPermitted(CarbonPlayer).- Parameters:
check- permission check- Returns:
- new permissions object
- Since:
- 3.0.0
-