fixed exact name matching

By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2011-01-17 16:55:48 -05:00
parent eeaaea9223
commit f69c8d2c8a

View file

@ -83,11 +83,11 @@ public final class CraftServer implements Server
for (Player player : players) {
if (player.getName().toLowerCase().startsWith(lowerName)) {
int curDelta = player.getName().length() - lowerName.length();
if(curDelta == 0) break;
if (curDelta < delta) {
found = player;
delta = curDelta;
}
if(curDelta == 0) break;
}
}
return found;