mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
fixed exact name matching
By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
parent
eeaaea9223
commit
f69c8d2c8a
1 changed files with 1 additions and 1 deletions
|
@ -83,11 +83,11 @@ public final class CraftServer implements Server
|
||||||
for (Player player : players) {
|
for (Player player : players) {
|
||||||
if (player.getName().toLowerCase().startsWith(lowerName)) {
|
if (player.getName().toLowerCase().startsWith(lowerName)) {
|
||||||
int curDelta = player.getName().length() - lowerName.length();
|
int curDelta = player.getName().length() - lowerName.length();
|
||||||
if(curDelta == 0) break;
|
|
||||||
if (curDelta < delta) {
|
if (curDelta < delta) {
|
||||||
found = player;
|
found = player;
|
||||||
delta = curDelta;
|
delta = curDelta;
|
||||||
}
|
}
|
||||||
|
if(curDelta == 0) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
|
|
Loading…
Reference in a new issue