如何通过UUID获得离线播放器?

时间:2014-05-21 16:29:31

标签: minecraft bukkit

如何通过UUID获得离线播放器?我可以通过UUID获得一个在线玩家,遍历所有在线玩家并在UUID匹配时返回,但我不知道如何为离线玩家做到这一点。

1 个答案:

答案 0 :(得分:1)

CraftBukkit的Beta版本(1.7.9-R0.1)具有org.bukkit.Server接口所需的方法:

/**
 * Gets the player by the given UUID, regardless if they are offline or
 * online.
 * <p>
 * This will return an object even if the player does not exist. To this
 * method, all players will exist.
 *
 * @param id the UUID of the player to retrieve
 * @return an offline player
 */
public OfflinePlayer getOfflinePlayer(UUID id);

JavaDoc

相关问题:BUKKIT-5501
相关提交:4bc86be4