Class ConsolePlayer

java.lang.Object
com.plotsquared.core.player.PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
com.plotsquared.core.player.ConsolePlayer
All Implemented Interfaces:
CommandCaller, LocaleHolder, PermissionHolder, OfflinePlotPlayer

public class ConsolePlayer extends PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
  • Method Details

    • getConsole

      public static ConsolePlayer getConsole()
    • toActor

      public com.sk89q.worldedit.extension.platform.Actor toActor()
      Specified by:
      toActor in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
    • getPlatformPlayer

      public com.sk89q.worldedit.extension.platform.Actor getPlatformPlayer()
      Specified by:
      getPlatformPlayer in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
    • canTeleport

      public boolean canTeleport(@NonNull Location location)
      Overrides:
      canTeleport in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
    • sendTitle

      public void sendTitle(@NonNull Caption title, @NonNull Caption subtitle, int fadeIn, int stay, int fadeOut, @NonNull net.kyori.adventure.text.minimessage.Template... replacements)
      Description copied from class: PlotPlayer
      Send a title to the player
      Overrides:
      sendTitle in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      title - Title
      subtitle - Subtitle
      fadeIn - Fade in time (in ticks)
      stay - The title stays for (in ticks)
      fadeOut - Fade out time (in ticks)
      replacements - Variable replacements
    • getLocation

      public @NonNull Location getLocation()
      Description copied from class: PlotPlayer
      Get this player's last recorded location or null if they don't any plot relevant location.
      Overrides:
      getLocation in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      The location
    • getLocationFull

      public Location getLocationFull()
      Description copied from class: PlotPlayer
      Get this player's full location (including yaw/pitch)
      Specified by:
      getLocationFull in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      location
    • getUUID

      public @NonNull UUID getUUID()
      Description copied from class: PlotPlayer
      Get this player's UUID. === !IMPORTANT ===
      The UUID is dependent on the mode chosen in the settings.yml and may not be the same as Bukkit has (especially if using an old version of Bukkit that does not support UUIDs)
      Specified by:
      getUUID in interface OfflinePlotPlayer
      Specified by:
      getUUID in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      UUID
    • getLastPlayed

      public long getLastPlayed()
      Description copied from interface: OfflinePlotPlayer
      Gets the time in milliseconds when the player was last seen online.
      Returns:
      the time in milliseconds when last online
    • hasPermission

      public boolean hasPermission(@NonNull String permission)
      Description copied from interface: CommandCaller
      Check the player's permissions. Will be cached if permission caching is enabled.
      Specified by:
      hasPermission in interface CommandCaller
      Specified by:
      hasPermission in interface PermissionHolder
      Overrides:
      hasPermission in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      permission - the name of the permission
      Returns:
      if permission is had
    • sendMessage

      public void sendMessage(@NonNull Caption caption, @NonNull net.kyori.adventure.text.minimessage.Template... replacements)
      Description copied from interface: CommandCaller
      Send a message to the command caller
      Specified by:
      sendMessage in interface CommandCaller
      Overrides:
      sendMessage in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      caption - Caption to send
      replacements - Variable replacements
    • teleport

      public void teleport(Location location, TeleportCause cause)
      Description copied from class: PlotPlayer
      Teleport this player to a location.
      Specified by:
      teleport in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      location - the target location
      cause - the cause of the teleport
    • getName

      public String getName()
      Description copied from interface: OfflinePlotPlayer
      Gets the name of this player.
      Returns:
      the player name
    • setCompassTarget

      public void setCompassTarget(Location location)
      Description copied from class: PlotPlayer
      Set this compass target.
      Specified by:
      setCompassTarget in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      location - the target location
    • setAttribute

      public void setAttribute(String key)
      Description copied from class: PlotPlayer
      Set player data that will persist restarts. - Please note that this is not intended to store large values - For session only data use meta
      Overrides:
      setAttribute in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      key - metadata key
    • getAttribute

      public boolean getAttribute(String key)
      Description copied from class: PlotPlayer
      Retrieves the attribute of this player.
      Overrides:
      getAttribute in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      key - metadata key
      Returns:
      the attribute will be either true or false
    • removeAttribute

      public void removeAttribute(String key)
      Description copied from class: PlotPlayer
      Remove an attribute from a player.
      Overrides:
      removeAttribute in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      key - metadata key
    • getSuperCaller

      public @NonNull RequiredType getSuperCaller()
      Description copied from interface: CommandCaller
      Get the type of the caller
      Specified by:
      getSuperCaller in interface CommandCaller
      Overrides:
      getSuperCaller in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      Caller type
    • setWeather

      public void setWeather(@NonNull PlotWeather weather)
      Description copied from class: PlotPlayer
      Sets the local weather for this Player.
      Specified by:
      setWeather in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      weather - the weather visible to the player
    • getGameMode

      public @NonNull com.sk89q.worldedit.world.gamemode.GameMode getGameMode()
      Description copied from class: PlotPlayer
      Get this player's gamemode.
      Specified by:
      getGameMode in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      the gamemode of the player.
    • setGameMode

      public void setGameMode(@NonNull com.sk89q.worldedit.world.gamemode.GameMode gameMode)
      Description copied from class: PlotPlayer
      Set this player's gameMode.
      Specified by:
      setGameMode in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      gameMode - the gamemode to set
    • setTime

      public void setTime(long time)
      Description copied from class: PlotPlayer
      Set this player's local time (ticks).
      Specified by:
      setTime in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      time - the time visible to the player
    • getFlight

      public boolean getFlight()
      Description copied from class: PlotPlayer
      Determines whether or not the player can fly.
      Specified by:
      getFlight in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      true if the player is allowed to fly
    • setFlight

      public void setFlight(boolean fly)
      Description copied from class: PlotPlayer
      Sets whether or not this player can fly.
      Specified by:
      setFlight in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      fly - true if the player can fly, otherwise false
    • playMusic

      public void playMusic(@NonNull Location location, @NonNull com.sk89q.worldedit.world.item.ItemType id)
      Description copied from class: PlotPlayer
      Play music at a location for this player.
      Specified by:
      playMusic in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      location - where to play the music
      id - the record item id
    • kick

      public void kick(String message)
      Description copied from class: PlotPlayer
      Kick this player from the game.
      Specified by:
      kick in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      message - the reason for the kick
    • stopSpectating

      public void stopSpectating()
      Specified by:
      stopSpectating in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
    • isBanned

      public boolean isBanned()
      Description copied from class: PlotPlayer
      Check if this player is banned.
      Specified by:
      isBanned in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      true if the player is banned, false otherwise.
    • getAudience

      public @NonNull net.kyori.adventure.audience.Audience getAudience()
      Description copied from class: PlotPlayer
      Get the Audience that represents this plot player
      Specified by:
      getAudience in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Returns:
      Player audience
    • canSee

      public boolean canSee(PlotPlayer<?> other)
      Description copied from class: PlotPlayer
      Check if the player is able to see the other player. This does not mean that the other player is in line of sight of the player, but rather that the player is permitted to see the other player.
      Specified by:
      canSee in class PlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
      Parameters:
      other - Other player
      Returns:
      true if the player is able to see the other player, false if not