From f6181be33cb5b267bb0215940424e93892772707 Mon Sep 17 00:00:00 2001 From: coding Date: Mon, 4 Dec 2017 07:14:35 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84api=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/api/command.js | 2 +- src/main/resources/api/event.js | 2 +- src/main/resources/api/item.js | 2 +- src/main/resources/api/{mserver.js => msp.js} | 3 ++- src/main/resources/api/permission.js | 2 +- src/main/resources/api/player.js | 2 ++ src/main/resources/api/plugin.js | 4 ++-- src/main/resources/api/server.js | 2 +- src/main/resources/api/task.js | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) rename src/main/resources/api/{mserver.js => msp.js} (85%) create mode 100644 src/main/resources/api/player.js diff --git a/src/main/resources/api/command.js b/src/main/resources/api/command.js index 1bf0396..d242a84 100644 --- a/src/main/resources/api/command.js +++ b/src/main/resources/api/command.js @@ -1,2 +1,2 @@ /*global Java, base, module, exports, require*/ -module.exports = require('./mserver').command; \ No newline at end of file +module.exports = require('./msp.js').command; \ No newline at end of file diff --git a/src/main/resources/api/event.js b/src/main/resources/api/event.js index 585de74..37ac009 100644 --- a/src/main/resources/api/event.js +++ b/src/main/resources/api/event.js @@ -1,2 +1,2 @@ /*global Java, base, module, exports, require*/ -module.exports = require('./mserver').event; \ No newline at end of file +module.exports = require('./msp.js').event; \ No newline at end of file diff --git a/src/main/resources/api/item.js b/src/main/resources/api/item.js index c2fdbac..d405417 100644 --- a/src/main/resources/api/item.js +++ b/src/main/resources/api/item.js @@ -1,2 +1,2 @@ /*global Java, base, module, exports, require*/ -module.exports = require('./mserver').item; \ No newline at end of file +module.exports = require('./msp.js').item; \ No newline at end of file diff --git a/src/main/resources/api/mserver.js b/src/main/resources/api/msp.js similarity index 85% rename from src/main/resources/api/mserver.js rename to src/main/resources/api/msp.js index 6674433..5038439 100644 --- a/src/main/resources/api/mserver.js +++ b/src/main/resources/api/msp.js @@ -9,5 +9,6 @@ module.exports = { permission: impl('permission'), server: impl('server'), task: impl('task'), - item: impl('item') + item: impl('item'), + player: impl('player') }; \ No newline at end of file diff --git a/src/main/resources/api/permission.js b/src/main/resources/api/permission.js index 107faaa..0ade738 100644 --- a/src/main/resources/api/permission.js +++ b/src/main/resources/api/permission.js @@ -1,2 +1,2 @@ /*global Java, base, module, exports, require*/ -module.exports = require('./mserver').permission; \ No newline at end of file +module.exports = require('./msp.js').permission; \ No newline at end of file diff --git a/src/main/resources/api/player.js b/src/main/resources/api/player.js new file mode 100644 index 0000000..eec4798 --- /dev/null +++ b/src/main/resources/api/player.js @@ -0,0 +1,2 @@ +/*global Java, base, module, exports, require*/ +module.exports = require('./msp.js').player; \ No newline at end of file diff --git a/src/main/resources/api/plugin.js b/src/main/resources/api/plugin.js index ecb9f42..53393bd 100644 --- a/src/main/resources/api/plugin.js +++ b/src/main/resources/api/plugin.js @@ -143,8 +143,8 @@ function initPlugin(file, plugin) { // 初始化插件配置相关方法 initPluginConfig(plugin); - command.enable(plugin); - permission.enable(plugin); + if (command.enable) command.enable(plugin); + if (permission.enable) permission.enable(plugin); } /** diff --git a/src/main/resources/api/server.js b/src/main/resources/api/server.js index 8f09fea..f673ba3 100644 --- a/src/main/resources/api/server.js +++ b/src/main/resources/api/server.js @@ -1,2 +1,2 @@ /*global Java, base, module, exports, require*/ -module.exports = require('./mserver').server; \ No newline at end of file +module.exports = require('./msp.js').server; \ No newline at end of file diff --git a/src/main/resources/api/task.js b/src/main/resources/api/task.js index 6ab9212..91a0929 100644 --- a/src/main/resources/api/task.js +++ b/src/main/resources/api/task.js @@ -1,2 +1,2 @@ /*global Java, base, module, exports, require*/ -module.exports = require('./mserver').task; \ No newline at end of file +module.exports = require('./msp.js').task; \ No newline at end of file