mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 01:25:03 +01:00
Simplify OfflinePlayer.getPlayer() logic.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
f0c27fe66c
commit
e19d7d24a2
1 changed files with 1 additions and 8 deletions
|
@ -144,14 +144,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
for (Object obj : server.getHandle().players) {
|
return server.getPlayer(getUniqueId());
|
||||||
EntityPlayer player = (EntityPlayer) obj;
|
|
||||||
if (player.getUniqueID().equals(getUniqueId())) {
|
|
||||||
return (player.playerConnection != null) ? player.playerConnection.getPlayer() : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue