mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 09:41:29 +01:00
Use PlayerList's UUID->EntityPlayer map in CraftServer.getPlayer(UUID)
By: zreed <zach@digitalforgemc.com>
This commit is contained in:
parent
986787060f
commit
475a7cb579
@ -415,13 +415,12 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: In 1.8+ this should use the server's UUID->EntityPlayer map
|
||||
@Override
|
||||
public Player getPlayer(UUID id) {
|
||||
for (Player player : getOnlinePlayers()) {
|
||||
if (player.getUniqueId().equals(id)) {
|
||||
return player;
|
||||
}
|
||||
EntityPlayer player = playerList.a(id);
|
||||
|
||||
if (player != null) {
|
||||
return player.getBukkitEntity();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user