feat: 添加获取玩家名称的API方法

This commit is contained in:
2022-10-29 02:11:51 +08:00
parent 02f613071f
commit 3707875e2f

View File

@@ -467,7 +467,6 @@ public abstract class BallAPI {
); );
} }
/** /**
* 把玩家传送到一个位置 * 把玩家传送到一个位置
* <p> * <p>
@@ -724,6 +723,21 @@ public abstract class BallAPI {
}); });
} }
/**
* 获取玩家名称
*
* @param uuid 玩家的 UUID
* @return 如果数据不存在,则返回字符串形式的 "null"
*/
@NotNull
public String getPlayerName(@NotNull UUID uuid) {
BallPlayerInfo info = getPlayerInfo(uuid);
if (info == null) {
return "null";
}
return info.getName();
}
@NotNull @NotNull
public ConcurrentHashMap<String, BallServerInfo> getAllServerInfo() { public ConcurrentHashMap<String, BallServerInfo> getAllServerInfo() {
return serverInfo; return serverInfo;