I can't believe we didn't have an unban command

This commit is contained in:
2022-01-29 19:31:10 -06:00
parent 0a1df0fddb
commit a95ea3557e
17 changed files with 133 additions and 47 deletions

View File

@ -25,11 +25,10 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@CommandParameters(name = "ban", usage = "/<command> <player> [reason]", aliases = "offlineban,gtfo", description = "Bans a player, offline or online")
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.ANY)
@CommandPermissions(level = Rank.ADMIN, permission = "plex.ban", source = RequiredCommandSource.ANY)
public class BanCMD extends PlexCommand
{
@Override
public Component execute(CommandSender sender, String[] args)
{
@ -69,7 +68,7 @@ public class BanCMD extends PlexCommand
punishment.setEndDate(new Date(Instant.now().plusSeconds(10/*PlexUtils.secondsToHours(24)*/).getEpochSecond()));
punishment.setCustomTime(false);
plugin.getPunishmentManager().doPunishment(punishedPlayer, punishment);
Bukkit.broadcast(componentFromString(sender.getName() + " - Banning " + plexPlayer.getName()));
PlexUtils.broadcast(tl("unbanningPlayer", sender.getName(), plexPlayer.getName()));
if (Bukkit.getPlayer(targetUUID) != null)
{
Bukkit.getPlayer(targetUUID).kick(componentFromString("&cYou've been banned."));