SPIGOT-6771: Help command tab completion does not respect permissions

This commit is contained in:
md_5 2021-10-24 20:33:42 +11:00
parent e337669a52
commit 58c2d3c7b8
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -122,6 +122,9 @@ public class HelpCommand extends BukkitCommand {
List<String> matchedTopics = new ArrayList<String>();
String searchString = args[0];
for (HelpTopic topic : Bukkit.getServer().getHelpMap().getHelpTopics()) {
if (!topic.canSee(sender)) {
continue;
}
String trimmedTopic = topic.getName().startsWith("/") ? topic.getName().substring(1) : topic.getName();
if (trimmedTopic.startsWith(searchString)) {