public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable
限定符和类型 | 方法和说明 |
---|---|
Location |
getBedSpawnLocation()
获取该玩家在床的重生点的Location对象,但如果该玩家从未使用过床或该重生点无效,则会返回null
原文:Gets the Location where the player will spawn at their bed, null if
they have not slept in one or their current bed spawn is invalid.
|
long |
getFirstPlayed()
获取该玩家第一次进入服务器的时间
原文:Gets the first date and time that this player was witnessed on this
server.
|
long |
getLastPlayed()
获取该玩家最后一次登录服务器的时间
原文:Gets the last date and time that this player was witnessed on this
server.
|
java.lang.String |
getName()
返回该玩家的游戏名
游戏名并不再是唯一的游戏标识,如果你希望长时间储存,建议使用
getUniqueId() 来替代
原文:Names are no longer unique past a single game session. |
Player |
getPlayer()
|
java.util.UUID |
getUniqueId()
返回该玩家的游戏UUID标识
|
boolean |
hasPlayedBefore()
检测该玩家是否在先前在此服游戏过
原文:Checks if this player has played on this server before.
|
boolean |
isBanned()
检测该玩家是否被封禁
|
boolean |
isOnline()
检查玩家是否在线
原文:Checks if this player is currently online
|
boolean |
isWhitelisted()
检测玩家是否存在白名单列表中
|
void |
setWhitelisted(boolean value)
将玩家添加到白名单列表或移除
|
isOp, setOp
serialize
boolean isOnline()
原文:Checks if this player is currently online
java.lang.String getName()
游戏名并不再是唯一的游戏标识,如果你希望长时间储存,建议使用getUniqueId()
来替代
原文:Names are no longer unique past a single game session. For persistent storage
it is recommended that you use getUniqueId()
instead.
getName
在接口中 AnimalTamer
java.util.UUID getUniqueId()
getUniqueId
在接口中 AnimalTamer
boolean isBanned()
boolean isWhitelisted()
void setWhitelisted(boolean value)
value
- 如果要添加到白名单列表内使用true,反之使用falsePlayer getPlayer()
Player
对象
原文:Gets a Player
object that this represents, if there is one
如果玩家在线,返回Player对象数据,反之返回null
long getFirstPlayed()
原文:Gets the first date and time that this player was witnessed on this server.
返回自1970年1月1日0日0分距当前时间的毫秒数.但如果该玩家从未进入服务器,则会返回0
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
long getLastPlayed()
原文:Gets the last date and time that this player was witnessed on this server.
返回自1970年1月1日0日0分距当前时间的毫秒数.但如果该玩家从未进入服务器,则会返回0
原文:If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
boolean hasPlayedBefore()
原文:Checks if this player has played on this server before.
Location getBedSpawnLocation()
原文:Gets the Location where the player will spawn at their bed, null if they have not slept in one or their current bed spawn is invalid.