package com.ttaylorr.uhc.pvp.services.util;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

import java.util.List;

public class PVPManagerCommand extends Command {
    CommandExecutor executor;
    public PVPManagerCommand(CommandExecutor executor, String name) {
        this(executor, name, name);
    }

    public PVPManagerCommand(CommandExecutor executor, String name, String description, String usageMessage, List<String> aliases) {
        this(executor, name, name, description, usageMessage, aliases);
    }

    public PVPManagerCommand(CommandExecutor executor, String name, String permission) {
        super(name);
        initialize(executor, name, permission);
    }

    public PVPManagerCommand(CommandExecutor executor, String name, String permission, String description, String usageMessage, List<String> aliases) {
        super(name, description, usageMessage, aliases);
        initialize(executor, name, permission);
    }

    private void initialize(CommandExecutor executor, String name, String permission) {
        this.executor = executor;
        setPermission("pvpmanager.command." + permission);
        setPermissionMessage("You are not allowed to run /pvp " + name);
    }

    @Override
    public boolean execute(CommandSender commandSender, String s, String[] strings) {
        return executor.onCommand(commandSender, this, s, strings);
    }
}

@@ -257,24 +257,25 @@
 r executor;%0A
+%0A
     public P
@@ -1273,24 +1273,196 @@
 me);%0A    %7D%0A%0A
+    public CommandExecutor getExecutor() %7B%0A        return executor;%0A    %7D%0A%0A    public void setExecutor(CommandExecutor executor) %7B%0A        this.executor = executor;%0A    %7D%0A%0A
     @Overrid

Allow changing of CommandExecutor in PVPManagerCommand