From 5256cbb8a81b9fdd955d2abd3ce6e82d94aa5e89 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 28 Feb 2011 10:35:58 +0000 Subject: [PATCH] PluginCommand getExecutor + javadocs By: Dinnerbone --- .../org/bukkit/command/PluginCommand.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/command/PluginCommand.java b/paper-api/src/main/java/org/bukkit/command/PluginCommand.java index 22087ff913..2f306bb84d 100644 --- a/paper-api/src/main/java/org/bukkit/command/PluginCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/PluginCommand.java @@ -2,6 +2,9 @@ package org.bukkit.command; import org.bukkit.plugin.Plugin; +/** + * Represents a {@link Command} belonging to a plugin + */ public final class PluginCommand extends Command { private final Plugin owningPlugin; private CommandExecutor executor; @@ -13,6 +16,14 @@ public final class PluginCommand extends Command { this.usageMessage = ""; } + /** + * Executes the command, returning its success + * + * @param sender Source object which is executing this command + * @param commandLabel The alias of the command used + * @param args All arguments passed to the command, split via ' ' + * @return true if the command was successful, otherwise false + */ public boolean execute(CommandSender sender, String commandLabel, String[] args) { boolean success = false; @@ -29,10 +40,24 @@ public final class PluginCommand extends Command { return success; } + /** + * Sets the {@link CommandExecutor} to run when parsing this command + * + * @param executor New executor to run + */ public void setExecutor(CommandExecutor executor) { this.executor = executor; } + /** + * Gets the {@link CommandExecutor} associated with this command + * + * @return CommandExecutor object linked to this command + */ + public CommandExecutor getExecutor() { + return executor; + } + /** * Gets the owner of this PluginCommand *