Interface IPlayer
- All Superinterfaces:
ICommandSender, IMessageable
- All Known Implementing Classes:
WrappedOfflinePlayer, WrappedPlayer
Represents a AnimatedArchitecture player.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringasString()Gets the player as a String in the format '"playerName" (playerUUID)'.default StringformatCommand(String commandName, String subCommandFormat, @Nullable Object @Nullable ... args) Formats a command appropriately for this command sender.Gets the value of theLimitfor this player.Gets the current location of this player.getName()Gets the name of this player.default longGets theIPlayerthat issued the command.default PlayerDataGets a thePlayerDatathat represents this player.getUUID()Gets the UUID of this player.hasPermission(String permission) Checks if this sender has a given permission.hasPermission(CommandDefinition command) Checks if this sender has a given command.booleanChecks if this player has a bypass permission node that allows them to bypass the protection hooks.booleanisOnline()Returns whether this player is online.booleanisOp()Checks if this player is an OP or not.default booleanisPlayer()Checks if the command sender is a player.Methods inherited from interface IMessageable
getPersonalizedLocalizer, getTextFactory, newText, sendError, sendInfo, sendMessage, sendMessage, sendSuccess
-
Method Details
-
getLocation
-
getPlayer
Description copied from interface:ICommandSenderGets theIPlayerthat issued the command.- Specified by:
getPlayerin interfaceICommandSender- Returns:
- The
IPlayerthat issued the command, if it was a player that issued the command. Otherwise, an empty Optional is returned.
-
isPlayer
default boolean isPlayer()Description copied from interface:ICommandSenderChecks if the command sender is a player.- Specified by:
isPlayerin interfaceICommandSender- Returns:
- True if the command sender is a player.
-
formatCommand
@FormatMethod default String formatCommand(String commandName, @FormatString String subCommandFormat, @Nullable Object @Nullable ... args) Description copied from interface:ICommandSenderFormats a command appropriately for this command sender.Players receive commands with a leading slash (e.g., "/command"), while non-players (console, command blocks) receive commands without the leading slash (e.g., "command").
- Specified by:
formatCommandin interfaceICommandSender- Parameters:
commandName- The name of the command (without leading slash).subCommandFormat- The format string for the subcommand and its arguments.args- Arguments referenced by the format specifiers in the subcommand format string.- Returns:
- The formatted command appropriate for this sender.
-
hasPermission
Description copied from interface:ICommandSenderChecks if this sender has a given permission.- Specified by:
hasPermissionin interfaceICommandSender- Parameters:
permission- The permission node to check.- Returns:
- True if the player has access to the provided permission, otherwise false.
-
hasPermission
Description copied from interface:ICommandSenderChecks if this sender has a given command.Both the user permission (See
CommandDefinition.getUserPermission()) and the admin permission (SeeCommandDefinition.getAdminPermission()) are checked.- Specified by:
hasPermissionin interfaceICommandSender- 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.
-
isOnline
boolean isOnline()Returns whether this player is online.- Returns:
- True if this player is online.
-
getName
-
getUUID
-
asString
Gets the player as a String in the format '"playerName" (playerUUID)'.- Returns:
- The player as a String.
-
hasProtectionBypassPermission
boolean hasProtectionBypassPermission()Checks if this player has a bypass permission node that allows them to bypass the protection hooks.- Returns:
- True if this player has permission to bypass the protection hooks.
-
getLimit
-
isOp
boolean isOp()Checks if this player is an OP or not.- Returns:
- True if the player is an OP.
-
getPlayerData
Gets a thePlayerDatathat represents this player. This may or may not be a new object.- Returns:
- The
PlayerDatathat represents this player.
-
getPermissionsFlag
default long getPermissionsFlag()
-