diff --git a/src/main/resources/api/command.js b/src/main/resources/api/command.js index e9a4187..2b90c40 100644 --- a/src/main/resources/api/command.js +++ b/src/main/resources/api/command.js @@ -2,14 +2,13 @@ function CommandHandlerDefault() { this.on = function(jsp, name, exec) { var cmd = this.create(jsp, { name: name }); + console.debug('插件 %s 创建命令 %s(%s)...'.format(jsp.description.name, name, cmd)) if (exec.cmd && typeof exec.cmd === "function") { - console.debug('插件 %s 设置命令 %s 执行器(%s) ...'.format(jsp.description.name, name, cmd)); this.onCommand(jsp, cmd, exec.cmd) } else { throw Error("CommandExec Must be a function... Input: " + exec.cmd) } if (exec.tab && typeof exec.tab === "function") { - console.debug('插件 %s 设置命令 %s 自动补全(%s) ...'.format(jsp.description.name, name, cmd)); this.onTabComplete(jsp, cmd, exec.tab) } } diff --git a/src/main/resources/internal/bukkit/command.js b/src/main/resources/internal/bukkit/command.js index ceec592..082bc4a 100644 --- a/src/main/resources/internal/bukkit/command.js +++ b/src/main/resources/internal/bukkit/command.js @@ -50,7 +50,7 @@ function disable(jsp) { function create(jsp, command) { var cmd = commandMap.getCommand(command.name) - if (cmd) { return cmd }; + if (cmd && cmd instanceof PluginCommand) { return cmd }; cmd = ref.on(PluginCommand).create(command.name, plugin).get(); commandMap.register(jsp.description.name, cmd); return cmd;