summaryrefslogtreecommitdiff
path: root/dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java')
-rw-r--r--dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java b/dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java
index b18694e..055171d 100644
--- a/dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java
+++ b/dicore3/command/src/main/java/io/dico/dicore/command/ICommandDispatcher.java
@@ -30,9 +30,24 @@ public interface ICommandDispatcher {
* @param buffer the command itself as a buffer.
* @return the address that is the target of the command.
*/
+ @Deprecated
ICommandAddress getCommandTarget(CommandSender sender, ArgumentBuffer buffer);
/**
+ * Similar to {@link #getDeepChild(ArgumentBuffer)},
+ * but this method incorporates checks on the command of traversed children:
+ * {@link Command#isVisibleTo(CommandSender)}
+ * and {@link Command#takePrecedenceOverSubcommand(String, ArgumentBuffer)}
+ * <p>
+ * The target of a command is never null, however, the same instance might be returned, and the returned address might not hold a command.
+ *
+ * @param context the context of the command. The context must not have its address set.
+ * @param buffer the command itself as a buffer.
+ * @return the address that is the target of the command.
+ */
+ ICommandAddress getCommandTarget(ExecutionContext context, ArgumentBuffer buffer) throws CommandException;
+
+ /**
* dispatch the command
*
* @param sender the sender