mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-05 09:20:52 +01:00
Implemented tab completion for /plot help
(#3053)
Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
parent
a17085bb18
commit
eb7eb15ee7
@ -37,7 +37,11 @@ import net.kyori.adventure.text.Component;
|
|||||||
import net.kyori.adventure.text.TextComponent;
|
import net.kyori.adventure.text.TextComponent;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@CommandDeclaration(command = "help",
|
@CommandDeclaration(command = "help",
|
||||||
aliases = "?",
|
aliases = "?",
|
||||||
@ -144,4 +148,13 @@ public class Help extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
|
||||||
|
return Stream.of("claiming", "teleport", "settings", "chat", "schematic", "appearance", "info", "debug",
|
||||||
|
"administration", "all")
|
||||||
|
.filter(value -> value.startsWith(args[0].toLowerCase(Locale.ENGLISH)))
|
||||||
|
.map(value -> new Command(null, false, value, "", RequiredType.NONE, null) {
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user