mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 02:55:47 +01:00
Added getPlayer(String name) to server
This commit is contained in:
parent
904c220d5c
commit
620c42b321
@ -59,6 +59,18 @@ public final class CraftServer implements Server {
|
||||
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) {
|
||||
return entity.a.getPlayer();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user