Package com.plotsquared.core.player
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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.plotsquared.core.player.PlotPlayer
PlotPlayer.PlotPlayerConverter<BaseObject>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canSee(PlotPlayer<?> other)
Check if the player is able to see the other player.boolean
canTeleport(@NonNull Location location)
boolean
getAttribute(String key)
Retrieves the attribute of this player.@NonNull net.kyori.adventure.audience.Audience
Get theAudience
that represents this plot playerstatic ConsolePlayer
boolean
Determines whether or not the player can fly.@NonNull com.sk89q.worldedit.world.gamemode.GameMode
Get this player's gamemode.long
Gets the time in milliseconds when the player was last seen online.@NonNull Location
Get this player's last recorded location or null if they don't any plot relevant location.Get this player's full location (including yaw/pitch)getName()
Gets the name of this player.com.sk89q.worldedit.extension.platform.Actor
@NonNull RequiredType
Get the type of the caller@NonNull UUID
getUUID()
Get this player's UUID. === !boolean
hasPermission(@NonNull String permission)
Check the player's permissions.boolean
isBanned()
Check if this player is banned.void
Kick this player from the game.void
Play music at a location for this player.void
removeAttribute(String key)
Remove an attribute from a player.void
sendMessage(@NonNull Caption caption, @NonNull net.kyori.adventure.text.minimessage.Template... replacements)
Send a message to the command callervoid
sendTitle(@NonNull Caption title, @NonNull Caption subtitle, int fadeIn, int stay, int fadeOut, @NonNull net.kyori.adventure.text.minimessage.Template... replacements)
Send a title to the playervoid
setAttribute(String key)
Set player data that will persist restartsvoid
setCompassTarget(Location location)
Set this compass target.void
setFlight(boolean fly)
Sets whether or not this player can fly.void
setGameMode(@NonNull com.sk89q.worldedit.world.gamemode.GameMode gameMode)
Set this player's gameMode.void
setTime(long time)
Set this player's local time (ticks).void
setWeather(@NonNull PlotWeather weather)
Sets the local weather for this Player.void
void
teleport(Location location, TeleportCause cause)
Teleport this player to a location.com.sk89q.worldedit.extension.platform.Actor
toActor()
Methods inherited from class com.plotsquared.core.player.PlotPlayer
accessPersistentMetaData, accessTemporaryMetaData, equals, from, getAllowedPlots, getApplicablePlotArea, getClusterCount, getClusterCount, getCurrentPlot, getDebugModePlayers, getDebugModePlayersInPlot, getLocale, getLockRepository, getMeta, getPlayerClusterCount, getPlayerClusterCount, getPlotAreaAbs, getPlotCount, getPlotCount, getPlots, getPlots, hasDebugMode, hashCode, hasKeyedPermission, hasPermission, plotkick, populatePersistentMetaMap, refreshDebug, registerConverter, sendActionBar, sendTitle, setLocale, setupPermissionProfile, teleport, toString, unregister
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.plotsquared.core.permissions.PermissionHolder
hasKeyedPermission, hasPermissionRange
-
Method Details
-
getConsole
-
toActor
public com.sk89q.worldedit.extension.platform.Actor toActor()- Specified by:
toActor
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
-
getPlatformPlayer
public com.sk89q.worldedit.extension.platform.Actor getPlatformPlayer()- Specified by:
getPlatformPlayer
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
-
canTeleport
- Overrides:
canTeleport
in classPlotPlayer<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 classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
title
- Titlesubtitle
- SubtitlefadeIn
- Fade in time (in ticks)stay
- The title stays for (in ticks)fadeOut
- Fade out time (in ticks)replacements
- Variable replacements
-
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 classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Returns:
- The location
-
getLocationFull
Description copied from class:PlotPlayer
Get this player's full location (including yaw/pitch)- Specified by:
getLocationFull
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Returns:
- location
-
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 interfaceOfflinePlotPlayer
- Specified by:
getUUID
in classPlotPlayer<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
Description copied from interface:CommandCaller
Check the player's permissions. Will be cached if permission caching is enabled.- Specified by:
hasPermission
in interfaceCommandCaller
- Specified by:
hasPermission
in interfacePermissionHolder
- Overrides:
hasPermission
in classPlotPlayer<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 interfaceCommandCaller
- Overrides:
sendMessage
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
caption
- Caption to sendreplacements
- Variable replacements
-
teleport
Description copied from class:PlotPlayer
Teleport this player to a location.- Specified by:
teleport
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
location
- the target locationcause
- the cause of the teleport
-
getName
Description copied from interface:OfflinePlotPlayer
Gets the name of this player.- Returns:
- the player name
-
setCompassTarget
Description copied from class:PlotPlayer
Set this compass target.- Specified by:
setCompassTarget
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
location
- the target location
-
setAttribute
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 classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
key
- metadata key
-
getAttribute
Description copied from class:PlotPlayer
Retrieves the attribute of this player.- Overrides:
getAttribute
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
key
- metadata key- Returns:
- the attribute will be either true or false
-
removeAttribute
Description copied from class:PlotPlayer
Remove an attribute from a player.- Overrides:
removeAttribute
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
key
- metadata key
-
getSuperCaller
Description copied from interface:CommandCaller
Get the type of the caller- Specified by:
getSuperCaller
in interfaceCommandCaller
- Overrides:
getSuperCaller
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Returns:
- Caller type
-
setWeather
Description copied from class:PlotPlayer
Sets the local weather for this Player.- Specified by:
setWeather
in classPlotPlayer<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 classPlotPlayer<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 classPlotPlayer<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 classPlotPlayer<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 classPlotPlayer<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 classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
fly
-true
if the player can fly, otherwisefalse
-
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 classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
location
- where to play the musicid
- the record item id
-
kick
Description copied from class:PlotPlayer
Kick this player from the game.- Specified by:
kick
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Parameters:
message
- the reason for the kick
-
stopSpectating
public void stopSpectating()- Specified by:
stopSpectating
in classPlotPlayer<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 classPlotPlayer<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 theAudience
that represents this plot player- Specified by:
getAudience
in classPlotPlayer<com.sk89q.worldedit.extension.platform.Actor>
- Returns:
- Player audience
-
canSee
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 classPlotPlayer<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
-