mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
Use PlayerList's UUID->EntityPlayer map in CraftServer.getPlayer(UUID)
This commit is contained in:
parent
e2c4f20ed1
commit
9e04f2f765
1 changed files with 4 additions and 5 deletions
|
@ -415,13 +415,12 @@ public final class CraftServer implements Server {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: In 1.8+ this should use the server's UUID->EntityPlayer map
|
|
||||||
@Override
|
@Override
|
||||||
public Player getPlayer(UUID id) {
|
public Player getPlayer(UUID id) {
|
||||||
for (Player player : getOnlinePlayers()) {
|
EntityPlayer player = playerList.a(id);
|
||||||
if (player.getUniqueId().equals(id)) {
|
|
||||||
return player;
|
if (player != null) {
|
||||||
}
|
return player.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue