package com.github.shynixn.astraledit.bukkit.logic.business.command;

import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand;
import com.github.shynixn.astraledit.api.bukkit.business.controller.SelectionController;
import com.github.shynixn.astraledit.bukkit.AstralEditPlugin;
import com.github.shynixn.astraledit.bukkit.Permission;
import com.github.shynixn.astraledit.bukkit.logic.business.Operation;
import com.github.shynixn.astraledit.bukkit.logic.business.OperationType;
import com.github.shynixn.astraledit.bukkit.logic.business.SelectionCommandExecutor;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

/**
 * Created by Shynixn 2018.
 * <p>
 * Version 1.2
 * <p>
 * MIT License
 * <p>
 * Copyright (c) 2018 by Shynixn
 * <p>
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * <p>
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * <p>
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
public class JoinCommand implements PlayerCommand {

    private final SelectionController selectionController;
    private final Plugin plugin;

    /**
     * Creates a new instance of the JoinCommand with SelectionController as dependency.
     *
     * @param selectionController dependency.
     */
    public JoinCommand(SelectionController selectionController, Plugin plugin) {
        this.selectionController = selectionController;
        this.plugin = plugin;
    }

    /**
     * Executes the given command if the arguments match.
     *
     * @param player executing the command.
     * @param args   arguments.
     * @return True if this command was executed. False if the arguments do not match.
     */
    @Override
    public boolean onPlayerExecuteCommand(Player player, String[] args) {

        if (args.length != 1 && !args[0].equalsIgnoreCase("join") && !Permission.JOIN.hasPermission(player)) {
            return false;
        }

        this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> {
            if (!this.selectionController.hasSelection(player)) {
                player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render.");
            } else if (!this.selectionController.getSelection(player).isJoined()) {
                this.selectionController.getSelection(player).join();
                this.selectionController.addOperation(player, new Operation(OperationType.COMBINE));
            }
        });

        return true;
    }
}

@@ -566,22 +566,14 @@
 tion
-CommandExecuto
+Manage
 r;%0Ai
@@ -1929,36 +1929,21 @@
 tion
-Controller selectionControll
+Manager manag
 er;%0A
@@ -2094,33 +2094,21 @@
  @param 
-selectionControll
+manag
 er depen
@@ -2158,36 +2158,21 @@
 tion
-Controller selectionControll
+Manager manag
 er, 
@@ -2205,47 +2205,23 @@
 his.
-selectionController = selectionControll
+manager = manag
 er;%0A
@@ -2850,33 +2850,21 @@
  (!this.
-selectionControll
+manag
 er.hasSe
@@ -3013,33 +3013,21 @@
  (!this.
-selectionControll
+manag
 er.getSe
@@ -3077,33 +3077,21 @@
    this.
-selectionControll
+manag
 er.getSe
@@ -3139,25 +3139,13 @@
 his.
-selectionControll
+manag
 er.a

Change SelectionController to SelectionManager