Updated commands to have optional aliases, and to fallback to /pluginName:cmdName on name conflict.
This commit is contained in:
29
src/main/java/org/bukkit/command/CommandMap.java
Normal file
29
src/main/java/org/bukkit/command/CommandMap.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package org.bukkit.command;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface CommandMap {
|
||||
/**
|
||||
* Registers all the commands belonging to a certain plugin.
|
||||
* @param plugin
|
||||
* @return
|
||||
*/
|
||||
public void registerAll(String fallbackPrefix, List<Command> commands);
|
||||
|
||||
/**
|
||||
* Registers a command. Returns true on success; false if name is already taken and fallback had to be used.
|
||||
*
|
||||
* @param a label for this command, without the '/'-prefix.
|
||||
* @return Returns true if command was registered; false if label was already in use.
|
||||
*/
|
||||
public boolean register(String label, String fallbackPrefix, Command command);
|
||||
|
||||
/** Looks for the requested command and executes it if found.
|
||||
*
|
||||
* @param cmdLine command + arguments. Example: "/test abc 123"
|
||||
* @return targetFound returns false if no target is found.
|
||||
*/
|
||||
public boolean dispatch(Player sender, String cmdLine);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user