mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
New player list caching system, further refinements and fixes
This commit is contained in:
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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user