java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.util.implementations.PlayerSpigot
All Implemented Interfaces:
IMessageable, IPlayer, ICommandSender

public final class PlayerSpigot extends Object implements IPlayer
Represents an implementation of IPlayer for the Spigot platform.
  • Constructor Details

    • PlayerSpigot

      public PlayerSpigot(org.bukkit.entity.Player spigotPlayer)
  • Method Details

    • getUUID

      public UUID getUUID()
    • hasProtectionBypassPermission

      public boolean hasProtectionBypassPermission()
    • getLocation

      public Optional<ILocation> getLocation()
      Description copied from interface: IPlayer
      Gets the current location of this player.
      Specified by:
      getLocation in interface IPlayer
      Returns:
      The current location of this player.
    • hasPermission

      public CompletableFuture<Boolean> hasPermission(String permission)
      Description copied from interface: ICommandSender
      Checks if this sender has a given permission.
      Specified by:
      hasPermission in interface ICommandSender
      Specified by:
      hasPermission in interface IPlayer
      Parameters:
      permission - The permission node to check.
      Returns:
      True if the player has access to the provided permission, otherwise false.
    • hasPermission

      public CompletableFuture<PermissionsStatus> hasPermission(CommandDefinition command)
      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
      Specified by:
      hasPermission in interface IPlayer
      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

      public boolean isOnline()
      Specified by:
      isOnline in interface IPlayer
      Returns:
      True if this player is online.
    • getLimit

      public OptionalInt getLimit(Limit limit)
    • isOp

      public boolean isOp()
    • getName

      public String getName()
    • sendMessage

      public void sendMessage(Text text)
      Description copied from interface: IMessageable
      Sends a message to this object.
      Specified by:
      sendMessage in interface IMessageable
      Parameters:
      text - The message to send. This may or may not contain formatting.
    • getBukkitPlayer

      public org.bukkit.entity.Player getBukkitPlayer()
      Gets the bukkit player represented by this IPlayer
      Returns:
      The Bukkit player.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • asString

      default String asString()
      Gets the player as a String in the format '"playerName" (playerUUID)'.
      Returns:
      The player as a String.
    • 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()