#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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user