doc: 清理调试代码

This commit is contained in:
coding 2017-11-15 12:56:23 +00:00
parent bc51852c46
commit 612d4ee856

View File

@ -76,9 +76,6 @@ var panel = item.create(160, 1, 13);
var config; var config;
var items; var items;
var lmap = [];
var cmap = [];
function load() { function load() {
config = this.config; config = this.config;
if (config.panel) { if (config.panel) {
@ -126,6 +123,9 @@ function newItemFromConfig(config) {
function enable() { function enable() {
command.on(this, 'l', { command.on(this, 'l', {
cmd: function (sender, command, args) { cmd: function (sender, command, args) {
if(!sender.openInventory){
console.sender(sender, "§4当前用户无法使用该命令!");
}
var inv = bukkit.$.createInventory(null, 54, config.title); var inv = bukkit.$.createInventory(null, 54, config.title);
inv.setContents(items); inv.setContents(items);
sender.openInventory(inv); sender.openInventory(inv);
@ -184,19 +184,14 @@ function enable() {
resultlist.push(t); resultlist.push(t);
} }
}); });
console.log(resultlist.toJson());
var ri = ext.random(resultlist.length); var ri = ext.random(resultlist.length);
console.log(ri);
var result = resultlist[ri]; var result = resultlist[ri];
console.log(result.toJson());
box.amount = box.amount - 1; box.amount = box.amount - 1;
key.amount = key.amount - 1; key.amount = key.amount - 1;
inv.setItem(10, box); inv.setItem(10, box);
inv.setItem(16, key); inv.setItem(16, key);
inv.setItem(40, newItemFromConfig(result.item)); inv.setItem(40, newItemFromConfig(result.item));
bukkit.console(result.command.replace('%player%', player.name)); bukkit.console(result.command.replace('%player%', player.name));
delete lmap[player.name];
delete cmap[player.name];
break; break;
default: default:
event.cancelled = true; event.cancelled = true;