Interface IPlayer

All Superinterfaces:
ICommandSender, IMessageable
All Known Implementing Classes:
WrappedOfflinePlayer, WrappedPlayer

public interface IPlayer extends ICommandSender
Represents a AnimatedArchitecture player.
  • Method Details

    • getLocation

      Optional<ILocation> getLocation()
      Gets the current location of this player.
      Returns:
      The current location of this player.
    • getPlayer

      default Optional<IPlayer> getPlayer()
      Description copied from interface: ICommandSender
      Gets the IPlayer that issued the command.
      Specified by:
      getPlayer in interface ICommandSender
      Returns:
      The IPlayer that 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: ICommandSender
      Checks if the command sender is a player.
      Specified by:
      isPlayer in interface ICommandSender
      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: ICommandSender
      Formats 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:
      formatCommand in interface ICommandSender
      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

      CompletableFuture<Boolean> hasPermission(String permission)
      Description copied from interface: ICommandSender
      Checks if this sender has a given permission.
      Specified by:
      hasPermission in interface ICommandSender
      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: ICommandSender
      Checks if this sender has a given command.

      Both the user permission (See CommandDefinition.getUserPermission()) and the admin permission (See CommandDefinition.getAdminPermission()) are checked.

      Specified by:
      hasPermission in interface ICommandSender
      Parameters:
      command - The CommandDefinition of a command to check.
      Returns:
      A PermissionsStatus that 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

      String getName()
      Gets the name of this player.
      Returns:
      The name of this player.
    • getUUID

      UUID getUUID()
      Gets the UUID of this player.
      Returns:
      The UUID of this player.
    • asString

      default String 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

      OptionalInt getLimit(Limit limit)
      Gets the value of the Limit for this player.

      Note that this does not take the global limit into account.

      Parameters:
      limit - The Limit to get the value of.
      Returns:
      The value of the limit for this player.
    • isOp

      boolean isOp()
      Checks if this player is an OP or not.
      Returns:
      True if the player is an OP.
    • getPlayerData

      default PlayerData getPlayerData()
      Gets a the PlayerData that represents this player. This may or may not be a new object.
      Returns:
      The PlayerData that represents this player.
    • getPermissionsFlag

      default long getPermissionsFlag()