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

import com.github.shynixn.astraledit.api.bukkit.AstralEditApi;
import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand;
import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection;
import com.github.shynixn.astraledit.bukkit.AstralEditPlugin;
import com.github.shynixn.astraledit.bukkit.Permission;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class RenderCommand implements PlayerCommand {

    private JavaPlugin plugin;

    /**
     * Creates an instance of RenderCommand which depends on a JavaPlugin
     * @param plugin the JavaPlugin
     */
    public RenderCommand(JavaPlugin plugin) {
        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("render") || !Permission.RENDER.hasPermission(player)) {
            return false;
        } else {
            createRenderCommand(player);
            return true;
        }
    }

    /**
     * Creates a new rendered object for the player
     *
     * @param player player
     */
    private void createRenderCommand(final Player player) {
        plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
            player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Rendering WorldEdit-Selection asynchronously...");
            final Selection selection = AstralEditApi.INSTANCE.render(player);
            if (selection == null) {
                player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "Failed rendering WE selection!");
                player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "Check if you selected an area with Worldedit.");
            } else {
                player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished rendering selection.");
            }
        });
    }
}

@@ -461,17 +461,8 @@
 gin.
-java.Java
 Plug
@@ -533,20 +533,16 @@
 private 
-Java
 Plugin p
@@ -620,27 +620,30 @@
 ds on a 
-Java
 Plugin%0A
+     *%0A
      * @
@@ -659,20 +659,16 @@
 gin the 
-Java
 Plugin%0A 
@@ -703,12 +703,8 @@
 and(
-Java
 Plug
@@ -1251,250 +1251,8 @@
     
-        createRenderCommand(player);%0A            return true;%0A        %7D%0A    %7D%0A%0A    /**%0A     * Creates a new rendered object for the player%0A     *%0A     * @param player player%0A     */%0A    private void createRenderCommand(final Player player) %7B%0A
     
@@ -1331,32 +1331,36 @@
 %3E %7B%0A            
+   
+ 
 player.sendMessa
@@ -1460,16 +1460,20 @@
         
+    
 final Se
@@ -1539,24 +1539,28 @@
             
+    
 if (selectio
@@ -1580,32 +1580,36 @@
                 
+ 
+   
 player.sendMessa
@@ -1674,24 +1674,28 @@
 lection!%22);%0A
+    
             
@@ -1803,32 +1803,36 @@
 %22);%0A            
+   
+ 
 %7D else %7B%0A       
@@ -1816,32 +1816,36 @@
        %7D else %7B%0A
+    
                 
@@ -1927,24 +1927,28 @@
 lection.%22);%0A
+    
             
@@ -1961,11 +1961,50 @@
     
-%7D);
+    %7D);%0A            return true;%0A        %7D
 %0A   

Remove the createRenderCommand()