diff options
author | ementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-13 21:10:49 +0000 |
---|---|---|
committer | ementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-13 21:10:49 +0000 |
commit | c4099dfb2123fd2bd53378dcfd355b43c694677a (patch) | |
tree | c679340d6d0f386edc8c74f9a1695b6312458a00 | |
parent | 3eb2022c2cbaa220248ed5972987d1fbf1da70bc (diff) | |
download | Essentials-c4099dfb2123fd2bd53378dcfd355b43c694677a.tar Essentials-c4099dfb2123fd2bd53378dcfd355b43c694677a.tar.gz Essentials-c4099dfb2123fd2bd53378dcfd355b43c694677a.tar.lz Essentials-c4099dfb2123fd2bd53378dcfd355b43c694677a.tar.xz Essentials-c4099dfb2123fd2bd53378dcfd355b43c694677a.zip |
[trunk] make user matching a bit less random
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1442 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java | 7 |
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)); } |