mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
Start command refactor
This commit is contained in:
1 parent
39e0b25d46
commit
3e27f7c5b1
57 files changed
+728
-384
No files matched your search
@@ -11,7 +11,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TpOfflineCommand extends CommandBase implements TabCompletable {
|
||||
public class TpOfflineCommand extends Command implements TabProvider {
|
||||
|
||||
protected TpOfflineCommand(@NotNull HuskHomes implementor) {
|
||||
super("tpoffline", Permission.COMMAND_TPOFFLINE, implementor);
|
||||
@@ -53,7 +53,7 @@ public class TpOfflineCommand extends CommandBase implements TabCompletable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> onTabComplete(@NotNull String[] args, @Nullable OnlineUser user) {
|
||||
public @NotNull List<String> suggest(@NotNull String[] args, @Nullable OnlineUser user) {
|
||||
return args.length <= 1 ? plugin.getCache().getPlayers().stream()
|
||||
.filter(s -> s.toLowerCase().startsWith(args.length == 1 ? args[0].toLowerCase() : ""))
|
||||
.sorted().collect(Collectors.toList()) : Collections.emptyList();
|
||||
|
||||
Reference in new issue
Block a user