Interface ICommandSender
- All Superinterfaces:
IMessageable
- All Known Implementing Classes:
OfflinePlayerSpigot,PlayerSpigot,SpigotServer
-
Nested Class Summary
Nested classes/interfaces inherited from interface nl.pim16aap2.animatedarchitecture.core.api.IMessageable
IMessageable.BlackHoleMessageable -
Field Summary
Fields inherited from interface nl.pim16aap2.animatedarchitecture.core.api.IMessageable
NULL -
Method Summary
Modifier and TypeMethodDescriptionGets theIPlayerthat issued the command.default CompletableFuture<Boolean> hasPermission(String permission) Checks if this sender has a given permission.default CompletableFuture<PermissionsStatus> hasPermission(CommandDefinition command) Checks if this sender has a given command.booleanisPlayer()Checks if the command sender is a player.Methods inherited from interface nl.pim16aap2.animatedarchitecture.core.api.IMessageable
sendError, sendInfo, sendMessage, sendMessage, sendSuccess
-
Method Details
-
getPlayer
Gets theIPlayerthat issued the command.- Returns:
- The
IPlayerthat issued the command, if it was a player that issued the command. Otherwise, an empty Optional is returned.
-
isPlayer
boolean isPlayer()Checks if the command sender is a player.- Returns:
- True if the command sender is a player.
-
hasPermission
Checks if this sender has a given permission.- Parameters:
permission- The permission node to check.- Returns:
- True if the player has access to the provided permission, otherwise false.
-
hasPermission
Checks if this sender has a given command.Both the user permission (See
CommandDefinition.getUserPermission()) and the admin permission (SeeCommandDefinition.getAdminPermission()) are checked.- Parameters:
command- TheCommandDefinitionof a command to check.- Returns:
- A
PermissionsStatusthat is true if the player has access to the provided permissions, otherwise false for the user and the admin permission nodes respectively.
-