From e4ab4ac8e34e8e67e6a8f93c7d544f51b894a5e3 Mon Sep 17 00:00:00 2001 From: Taah Date: Mon, 6 May 2024 12:31:27 -0700 Subject: [PATCH] remove banlist from tfm extras --- .../plex/extras/command/BanListCommand.java | 60 ------------------- .../extras/command/slime/MyWorldCommand.java | 1 - 2 files changed, 61 deletions(-) delete mode 100755 src/main/java/dev/plex/extras/command/BanListCommand.java diff --git a/src/main/java/dev/plex/extras/command/BanListCommand.java b/src/main/java/dev/plex/extras/command/BanListCommand.java deleted file mode 100755 index 1f99532..0000000 --- a/src/main/java/dev/plex/extras/command/BanListCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -package dev.plex.extras.command; - -import com.google.common.collect.ImmutableList; -import dev.plex.command.PlexCommand; -import dev.plex.command.annotation.CommandParameters; -import dev.plex.command.annotation.CommandPermissions; -import dev.plex.punishment.Punishment; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; -import net.kyori.adventure.text.Component; -import org.apache.commons.lang3.StringUtils; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -@CommandParameters(name = "banlist", description = "Manages the banlist", usage = "/ [purge]") -@CommandPermissions(permission = "plex.tfmextras.banlist") -public class BanListCommand extends PlexCommand -{ - @Override - protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args) - { - if (args.length == 0) - { - plugin.getPunishmentManager().getActiveBans().whenComplete((punishments, throwable) -> - { - send(sender, mmString("Active Bans (" + punishments.size() + "): " + StringUtils.join(punishments.stream().map(Punishment::getPunishedUsername).collect(Collectors.toList()), ", "))); - }); - return null; - } - if (args[0].equalsIgnoreCase("purge")) - { - if (sender instanceof Player) - { - return messageComponent("noPermissionInGame"); - } - if (!sender.getName().equalsIgnoreCase("console")) - { - if (!checkPermission(sender, "plex.tfmextras.banlist.clear")) - { - return null; - } - } - plugin.getPunishmentManager().getActiveBans().whenComplete((punishments, throwable) -> - { - punishments.forEach(plugin.getPunishmentManager()::unban); - send(sender, mmString("Unbanned " + punishments.size() + " players.")); - }); - } - return null; - } - - @Override - public @NotNull List smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException - { - return args.length == 1 && silentCheckPermission(sender, "plex.tfmextras.banlist.clear") ? Collections.singletonList("purge") : ImmutableList.of(); - } -} diff --git a/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java b/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java index 76722a9..cf6820d 100644 --- a/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java +++ b/src/main/java/dev/plex/extras/command/slime/MyWorldCommand.java @@ -25,7 +25,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import redis.clients.jedis.Jedis; @CommandParameters(name = "myworld", usage = "/ [player]") @CommandPermissions(permission = "plex.tfmextras.myworld", source = RequiredCommandSource.IN_GAME)