mirror of https://github.com/plexusorg/Plex.git
Altered tab completion to include "clear" argument
This commit is contained in:
parent
a12eb83b73
commit
ee9a0aafa5
|
@ -16,6 +16,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
@CommandPermissions(permission = "plex.whohas")
|
@CommandPermissions(permission = "plex.whohas")
|
||||||
@CommandParameters(name = "whohas", description = "Returns a list of players with a specific item in their inventory.", usage = "/<command> <material>", aliases = "wh")
|
@CommandParameters(name = "whohas", description = "Returns a list of players with a specific item in their inventory.", usage = "/<command> <material>", aliases = "wh")
|
||||||
|
@ -65,6 +66,14 @@ public class WhoHasCMD extends PlexCommand
|
||||||
@Override
|
@Override
|
||||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||||
{
|
{
|
||||||
return args.length == 1 && silentCheckPermission(sender, this.getPermission()) ? Arrays.stream(Material.values()).map(Enum::name).toList() : ImmutableList.of();
|
if (args.length == 1 && silentCheckPermission(sender, this.getPermission()))
|
||||||
|
{
|
||||||
|
return Arrays.stream(Material.values()).map(Enum::name).toList();
|
||||||
|
}
|
||||||
|
else if (args.length == 2 && silentCheckPermission(sender, this.getPermission()))
|
||||||
|
{
|
||||||
|
return Collections.singletonList("clear");
|
||||||
|
}
|
||||||
|
return ImmutableList.of();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue