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