#727 Instantiate ExecutableCommand objects in CommandHandler

- Change CommandDescription to contain a reference to ExecutableCommand class only
- Instantiate the actual ExecutableCommand objects in CommandHandler
This commit is contained in:
ljacqu
2016-06-04 21:13:38 +02:00
parent c6778b566d
commit 26ac466035
19 changed files with 320 additions and 331 deletions
@@ -53,7 +53,7 @@ public class HelpProvider implements SettingsDependent {
loadSettings(settings);
}
public List<String> printHelp(CommandSender sender, FoundCommandResult result, int options) {
private List<String> printHelp(CommandSender sender, FoundCommandResult result, int options) {
if (result.getCommandDescription() == null) {
return singletonList(ChatColor.DARK_RED + "Failed to retrieve any help information!");
}
@@ -87,6 +87,20 @@ public class HelpProvider implements SettingsDependent {
return lines;
}
/**
* Output the help for a given command.
*
* @param sender The sender to output the help to
* @param result The result to output information about
* @param options Output options, see {@link HelpProvider}
*/
public void outputHelp(CommandSender sender, FoundCommandResult result, int options) {
List<String> lines = printHelp(sender, result, options);
for (String line : lines) {
sender.sendMessage(line);
}
}
@Override
public void loadSettings(NewSetting settings) {
helpHeader = settings.getProperty(PluginSettings.HELP_HEADER);