Skip to content

Commit

Permalink
don't auto filter via player names
Browse files Browse the repository at this point in the history
  • Loading branch information
Badbird5907 committed Jan 5, 2024
1 parent e6376b3 commit fca8be7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,17 @@ public Player provideDefault(CommandContext context, CommandInfo commandInfo, Pa

@Override
public List<String> provideSuggestions(String input, String lastArg, CoreCommandSender s) {
return suggest(input, s);
return suggest(s);
}

public static List<String> suggest(String input, CoreCommandSender s) {
public static List<String> suggest(CoreCommandSender s) {
List<String> list = new ArrayList<>();
BukkitCommandSenderImpl sender = (BukkitCommandSenderImpl) s;
if (sender instanceof Player) {
Player p = sender.getPlayer();
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (p.canSee(onlinePlayer)) {
if (onlinePlayer.getName().toLowerCase().startsWith(input.toLowerCase())) {
list.add(playerNameFunction.apply(onlinePlayer));
}
list.add(playerNameFunction.apply(onlinePlayer));
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion Commander-Core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {
}

group = "net.octopvp"
version = "0.0.8-REL"
version = "0.0.9-REL"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion Commander-JDA/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = "net.octopvp"
version = "0.0.8-REL"
version = "0.0.9-REL"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.0.8-REL
version=0.0.9-REL

0 comments on commit fca8be7

Please sign in to comment.