package com.campmongoose.serversaturday.spigot.command;

import com.campmongoose.serversaturday.common.command.AbstractCommand;
import com.campmongoose.serversaturday.spigot.SpigotServerSaturday;
import com.campmongoose.serversaturday.spigot.submission.SpigotBuild;
import com.campmongoose.serversaturday.spigot.submission.SpigotSubmissions;
import com.campmongoose.serversaturday.spigot.submission.SpigotSubmitter;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

public abstract class AbstractSpigotCommand extends AbstractCommand<SpigotCommandArgument, SpigotBuild, AbstractSpigotCommand, SpigotServerSaturday, Location, String, Player, SpigotSubmitter, Boolean, SpigotSubmissions, ItemStack, SpigotCommandUsage, SpigotCommandPermissions, CommandSender> implements CommandExecutor {

    public AbstractSpigotCommand(String name, String description) {
        super(name, description);
    }

    @Nonnull
    @Override
    public String getHelp() {
        return usage.getUsage() + " " + ChatColor.AQUA + description;
    }

    @Nonnull
    @Override
    protected SpigotServerSaturday getPluginInstance() {
        return SpigotServerSaturday.instance();
    }

    @Nonnull
    @Override
    protected SpigotSubmissions getSubmissions() {
        return getPluginInstance().getSubmissions();
    }

    @Nonnull
    @Override
    protected SpigotSubmitter getSubmitter(@Nonnull Player player) {
        return getSubmissions().getSubmitter(player);
    }

    @Nullable
    @Override
    protected SpigotSubmitter getSubmitter(@Nonnull String playerName) {
        UUID uuid = getPluginInstance().getUUIDCache().getUUIDOf(playerName);
        if (uuid != null) {
            SpigotSubmitter submitter = getSubmitter(uuid);
            if (submitter != null) {
                return submitter;
            }

            for (SpigotSubmitter s : getSubmissions().getSubmitters()) {
                if (s.getName().equalsIgnoreCase(playerName)) {
                    return s;
                }
            }
        }

        return null;
    }

    @Nullable
    protected SpigotSubmitter getSubmitter(@Nonnull UUID uuid) {
        return getSubmissions().getSubmitter(uuid);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (permissions.testPermission(sender)) {
            if (usage.minArgsMet(sender, args.length)) {
                return executor.apply(sender, Arrays.asList(args));
            }
        }

        return false;
    }

    /**
     * @param sender
     * @param args
     * @return
     * @deprecated placeholder until commands are all separated
     */
    @Deprecated
    public boolean onCommand(CommandSender sender, List<String> args) {
        if (permissions.testPermission(sender)) {
            if (usage.minArgsMet(sender, args.size())) {
                return executor.apply(sender, args);
            }
        }

        return false;
    }
}

@@ -438,31 +438,8 @@
 ys;%0A
-import java.util.List;%0A
 impo
@@ -2818,445 +2818,8 @@
  %7D%0A%0A
-        return false;%0A    %7D%0A%0A    /**%0A     * @param sender%0A     * @param args%0A     * @return%0A     * @deprecated placeholder until commands are all separated%0A     */%0A    @Deprecated%0A    public boolean onCommand(CommandSender sender, List%3CString%3E args) %7B%0A        if (permissions.testPermission(sender)) %7B%0A            if (usage.minArgsMet(sender, args.size())) %7B%0A                return executor.apply(sender, args);%0A            %7D%0A        %7D%0A%0A
     

Remove deprecated method.