mirror of
https://github.com/plexusorg/Plex.git
synced 2025-07-13 10:38:35 +00:00
Tab completer improvements (#80)
* Attempt to improve the tab completion for Plex * i give up for the night * steven is a god * Fix permission node
This commit is contained in:
@ -12,6 +12,11 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(permission = "plex.blockedit")
|
||||
@CommandParameters(name = "blockedit", usage = "/<command> [list | purge | all | <player>]", aliases = "bedit", description = "Prevent players from modifying blocks")
|
||||
public class BlockEditCMD extends PlexCommand
|
||||
@ -94,4 +99,20 @@ public class BlockEditCMD extends PlexCommand
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
if (silentCheckPermission(sender, this.getPermission()))
|
||||
{
|
||||
List<String> options = new ArrayList<>();
|
||||
if (args.length == 1)
|
||||
{
|
||||
options.addAll(Arrays.asList("list", "purge", "all"));
|
||||
options.addAll(PlexUtils.getPlayerNameList());
|
||||
return options;
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user