mirror of
https://github.com/plexusorg/ExampleModule.git
synced 2025-07-13 00:18:35 +00:00
Adds required tab completion
This commit is contained in:
@ -2,6 +2,9 @@ package dev.plex.command;
|
||||
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -17,4 +20,23 @@ public class ExampleCommand extends PlexCommand
|
||||
{
|
||||
return Component.text("Example module command");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
if (silentCheckPermission(sender, this.getPermission()))
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return Arrays.asList("option1", "option2", "option3");
|
||||
}
|
||||
|
||||
if (args.length == 2)
|
||||
{
|
||||
return Arrays.asList("option3", "option4");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user