parent
aa324f54db
commit
bf4c508bc5
|
@ -83,7 +83,7 @@ public class CommandManager implements TabExecutor {
|
||||||
* @param executor
|
* @param executor
|
||||||
* 命令执行类
|
* 命令执行类
|
||||||
*/
|
*/
|
||||||
public CommandManager(final String name, final CommandExecutor executor) {
|
public CommandManager(final String name, final CommandExecutor... executor) {
|
||||||
this(name);
|
this(name);
|
||||||
register(executor);
|
register(executor);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,8 @@ public class CommandManager implements TabExecutor {
|
||||||
* @param clazz
|
* @param clazz
|
||||||
* 子命令处理类
|
* 子命令处理类
|
||||||
*/
|
*/
|
||||||
public void register(final CommandExecutor clazz) {
|
public void register(final CommandExecutor... clazzs) {
|
||||||
|
for (final CommandExecutor clazz : clazzs) {
|
||||||
final Method[] methods = clazz.getClass().getDeclaredMethods();
|
final Method[] methods = clazz.getClass().getDeclaredMethods();
|
||||||
for (final Method method : methods) {
|
for (final Method method : methods) {
|
||||||
if (registerCommand(method, clazz)) {
|
if (registerCommand(method, clazz)) {
|
||||||
|
@ -134,6 +135,7 @@ public class CommandManager implements TabExecutor {
|
||||||
}
|
}
|
||||||
registerTab(method, clazz);
|
registerTab(method, clazz);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
help = new CommandHelp(cmds);
|
help = new CommandHelp(cmds);
|
||||||
buildCmdNameCache();
|
buildCmdNameCache();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue