(work in progress) - Pass all dependencies via constructor - Encapsulate command handling more (e.g. split CommandHandler with new CommandMapper) - Add help command to all base commands at one central point See AccountsCommand or HelpCommand for an example of the advantages - all necessary functions come from CommandService; objects aren't retrieved through a singleton getInstance() method anymore
22 lines
526 B
Java
22 lines
526 B
Java
package fr.xephi.authme.command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Base class for AuthMe commands that can be executed.
|
|
*/
|
|
public interface ExecutableCommand {
|
|
|
|
/**
|
|
* Execute the command with the given arguments.
|
|
*
|
|
* @param sender The command sender.
|
|
* @param arguments The arguments.
|
|
* @param commandService The command service.
|
|
*/
|
|
void executeCommand(CommandSender sender, List<String> arguments, CommandService commandService);
|
|
|
|
}
|