New player list caching system, further refinements and fixes

This commit is contained in:
William committed 2023-03-21 12:49:36 +00:00
1 parent 054811676d
commit 93dd15007a
59 files changed
+445 -317

No files matched your search

@@ -1,7 +1,6 @@
package net.william278.huskhomes.command;
import net.william278.huskhomes.user.CommandUser;
import net.william278.huskhomes.user.ConsoleUser;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -29,15 +28,4 @@ public interface TabProvider {
.toList();
}
@NotNull
static List<String> getMatchingNames(@Nullable String argument, @NotNull CommandUser user,
@NotNull List<? extends Node> providers) {
return providers.stream()
.filter(command -> !(user instanceof ConsoleUser) || command.isConsoleExecutable())
.map(Node::getName)
.filter(commandName -> argument == null || argument.isBlank() || commandName.toLowerCase()
.startsWith(argument.toLowerCase().trim()))
.toList();
}
}