From 161d48858d899761eef8259ffc6ded3477faf550 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 3 Jan 2011 00:16:00 +0000 Subject: [PATCH] Added getPlayer(String name) to server By: Dinnerbone --- .../java/org/bukkit/craftbukkit/CraftServer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index d9a4dec8d3..70f78cd87e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -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(); }