mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Added getPlayer(String name) to server
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
ca642baafd
commit
161d48858d
1 changed files with 12 additions and 0 deletions
|
@ -59,6 +59,18 @@ public final class CraftServer implements Server {
|
||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Player getPlayer(final String name) {
|
||||||
|
Player[] players = getOnlinePlayers();
|
||||||
|
|
||||||
|
for (Player player : players) {
|
||||||
|
if (player.getName().equalsIgnoreCase(name)) {
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public Player getPlayer(final EntityPlayerMP entity) {
|
public Player getPlayer(final EntityPlayerMP entity) {
|
||||||
return entity.a.getPlayer();
|
return entity.a.getPlayer();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue