summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
index f7110ac7f..c7264c21d 100644
--- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
@@ -32,6 +32,13 @@ public abstract class EssentialsCommand implements IEssentialsCommand
if (args.length <= pos) throw new IndexOutOfBoundsException("§cInvalid command syntax. Did you forget an argument?");
List<Player> matches = server.matchPlayer(args[pos]);
if (matches.size() < 1) throw new NoSuchFieldException("§cNo matching players could be found.");
+ for (Player p : matches)
+ {
+ if (p.getDisplayName().startsWith(args[pos]))
+ {
+ return ess.getUser(p);
+ }
+ }
return ess.getUser(matches.get(0));
}