如何通过UUID获得离线播放器? [英] How to get an offline player by UUID?
本文介绍了如何通过UUID获得离线播放器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何通过UUID获取离线播放器?我可以通过遍历所有在线播放器来获得UUID的在线播放器,并在UUID匹配时返回,但是我不知道如何为离线播放器执行此操作.
How to get an offline player by UUID? I can get an online player by UUID by iterating through all online players and return when an UUID matches, but I don't know how to do this for offline players.
推荐答案
Beta版本的CraftBukkit(1.7.9-R0.1)在org.bukkit.Server
界面中具有您需要的方法:
Beta build of CraftBukkit (1.7.9-R0.1) has the method you need in org.bukkit.Server
interface:
/**
* 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);
相关问题: BUKKIT-5501
相关提交: 4bc86be4
Related issue: BUKKIT-5501
Related commit: 4bc86be4
这篇关于如何通过UUID获得离线播放器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文