From 612d4ee856c1770b9317604f4935ec6b989ff469 Mon Sep 17 00:00:00 2001 From: coding Date: Wed, 15 Nov 2017 12:56:23 +0000 Subject: [PATCH] =?UTF-8?q?doc:=20=E6=B8=85=E7=90=86=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/plugins/Lottery.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/resources/plugins/Lottery.js b/src/main/resources/plugins/Lottery.js index b96eb7e..3869243 100644 --- a/src/main/resources/plugins/Lottery.js +++ b/src/main/resources/plugins/Lottery.js @@ -76,9 +76,6 @@ var panel = item.create(160, 1, 13); var config; var items; -var lmap = []; -var cmap = []; - function load() { config = this.config; if (config.panel) { @@ -126,6 +123,9 @@ function newItemFromConfig(config) { function enable() { command.on(this, 'l', { cmd: function (sender, command, args) { + if(!sender.openInventory){ + console.sender(sender, "§4当前用户无法使用该命令!"); + } var inv = bukkit.$.createInventory(null, 54, config.title); inv.setContents(items); sender.openInventory(inv); @@ -184,19 +184,14 @@ function enable() { resultlist.push(t); } }); - console.log(resultlist.toJson()); var ri = ext.random(resultlist.length); - console.log(ri); var result = resultlist[ri]; - console.log(result.toJson()); box.amount = box.amount - 1; key.amount = key.amount - 1; inv.setItem(10, box); inv.setItem(16, key); inv.setItem(40, newItemFromConfig(result.item)); bukkit.console(result.command.replace('%player%', player.name)); - delete lmap[player.name]; - delete cmap[player.name]; break; default: event.cancelled = true;