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