Plex/src/main/java/dev/plex/command/impl/PunishmentsCMD.java

35 lines
1.3 KiB
Java
Raw Normal View History

2021-01-03 07:21:15 +00:00
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
2022-01-04 03:04:39 +00:00
import dev.plex.command.PlexCommand;
2021-01-03 07:21:15 +00:00
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.menu.PunishmentMenu;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@CommandParameters(name = "punishments", usage = "/<command> [player]", description = "Opens the Punishments GUI", aliases = "punishlist,punishes")
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME)
public class PunishmentsCMD extends PlexCommand
{
@Override
2022-01-27 05:28:30 +00:00
public Component execute(CommandSender sender, String[] args)
{
new PunishmentMenu().openInv(((Player) sender), 0);
return null;
}
@Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{
return args.length == 1 ? PlexUtils.getPlayerNameList() : ImmutableList.of();
}
}