Plex/src/main/java/dev/plex/command/impl/PunishmentsCMD.java
2021-01-03 01:21:15 -06:00

37 lines
1.1 KiB
Java

package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.command.PlexCommand;
import dev.plex.menu.PunishmentMenu;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player;
import java.util.List;
@CommandParameters(usage = "/<command> [player]", description = "Opens the Punishments GUI", aliases = "punishlist,punishes")
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME)
public class PunishmentsCMD extends PlexCommand
{
public PunishmentsCMD() {
super("punishments");
}
@Override
public void execute(CommandSource sender, String[] args)
{
Player player = sender.getPlayer();
new PunishmentMenu().openInv(player, 0);
}
@Override
public List<String> onTabComplete(CommandSource sender, String[] args) {
return args.length == 1 ? PlexUtils.getPlayerNameList() : ImmutableList.of();
}
}