Use regular player name when tab completing /ma kick and /ma restore.
Since the actual execution of these commands use the regular player name instead of the display name, the tab completion is useless if it doesn't also use the regular player name. Fixes #589
This commit is contained in:
1 parent
9890c13391
commit
ab2fefd3d3
3 files changed
+5
-4
No files matched your search
@@ -52,8 +52,8 @@ public class KickCommand implements Command
|
||||
List<Player> players = am.getAllPlayers();
|
||||
|
||||
return players.stream()
|
||||
.filter(p -> p.getDisplayName().toLowerCase().startsWith(prefix))
|
||||
.map(Player::getDisplayName)
|
||||
.filter(p -> p.getName().toLowerCase().startsWith(prefix))
|
||||
.map(Player::getName)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -55,8 +55,8 @@ public class RestoreCommand implements Command
|
||||
Collection<? extends Player> players = am.getPlugin().getServer().getOnlinePlayers();
|
||||
|
||||
return players.stream()
|
||||
.filter(p -> p.getDisplayName().toLowerCase().startsWith(prefix))
|
||||
.map(Player::getDisplayName)
|
||||
.filter(p -> p.getName().toLowerCase().startsWith(prefix))
|
||||
.map(Player::getName)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user