LoginSystem/src/main/java/fr/xephi/authme/command/ExecutableCommand.java
ljacqu 6cf8789fe0 #758 Show login usage message on invalid arguments, #1053 send translatable "no permission" message
- Add default method to ExecutableCommand interface that allows to define the message key to show if a command's arguments are invalid. If not defined the behavior is as before: show the output of /<command> help
- Use translatable "no permission" message instead of hardcoded one
2017-01-05 20:47:14 +01:00

32 lines
889 B
Java

package fr.xephi.authme.command;
import fr.xephi.authme.message.MessageKey;
import org.bukkit.command.CommandSender;
import java.util.List;
/**
* Base class for AuthMe commands that can be executed.
*/
public interface ExecutableCommand {
/**
* Executes the command with the given arguments.
*
* @param sender the command sender (initiator of the command)
* @param arguments the arguments
*/
void executeCommand(CommandSender sender, List<String> arguments);
/**
* Returns the message to show to the user if the command is used with the wrong commands.
* If null is returned, the standard help (/<i>command</i> help) output is shown.
*
* @return the message explaining the command's usage, or {@code null} for default behavior
*/
default MessageKey getArgumentsMismatchMessage() {
return null;
}
}