Package net.draycia.carbon.api.channels
Interface ChannelPermissionResult
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public interface ChannelPermissionResult
Represents the result of a channel permission check.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelPermissionResultallowed()Returns a result denoting that the player is permitted for the action.static ChannelPermissionResultchannelPermissionResult(boolean allowed, Supplier<Component> denyReason) static ChannelPermissionResultReturns a result denoting that the action is denied for the player.static ChannelPermissionResultReturns a result denoting that the action is denied for the player.booleanCheck whether the action checked was permitted.reason()Reason for permission being denied.
-
Method Details
-
permitted
boolean permitted()Check whether the action checked was permitted.- Returns:
- permitted
- Since:
- 3.0.0
-
reason
Component reason()Reason for permission being denied. When the action was permitted, this should be equal toComponent.empty().- Returns:
- deny reason
- Since:
- 3.0.0
-
allowed
Returns a result denoting that the player is permitted for the action.- Returns:
- that the action is allowed
- Since:
- 3.0.0
-
denied
Returns a result denoting that the action is denied for the player.- Parameters:
reason- the reason the action was denied- Returns:
- that the action is denied
- Since:
- 3.0.0
-
denied
Returns a result denoting that the action is denied for the player.- Parameters:
reason- the reason the action was denied- Returns:
- that the action is denied
- Since:
- 3.0.0
-
channelPermissionResult
static ChannelPermissionResult channelPermissionResult(boolean allowed, Supplier<Component> denyReason) - Parameters:
allowed- whether the result is alloweddenyReason- deny reason supplier- Returns:
- permission result
- Since:
- 3.0.0
-