summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-01-03 00:16:00 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-01-03 00:16:00 +0000
commit620c42b321400454fb7b9da0ea63760a89da94df (patch)
treeec1a0dcf70d44f2403a4c365fc9b9be0ec39fa8b /src
parent904c220d5c6f201cc8e869f786822e181b719a8b (diff)
downloadcraftbukkit-620c42b321400454fb7b9da0ea63760a89da94df.tar
craftbukkit-620c42b321400454fb7b9da0ea63760a89da94df.tar.gz
craftbukkit-620c42b321400454fb7b9da0ea63760a89da94df.tar.lz
craftbukkit-620c42b321400454fb7b9da0ea63760a89da94df.tar.xz
craftbukkit-620c42b321400454fb7b9da0ea63760a89da94df.zip
Added getPlayer(String name) to server
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d9a4dec8..70f78cd8 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();
}