fix: 修复玩家人数获取错误 更新插件
This commit is contained in:
parent
be95acd001
commit
e290f17771
@ -52,7 +52,7 @@ function send(event, player){
|
|||||||
console.debug('玩家', player.getName(), "触发事件", event.class.simpleName);
|
console.debug('玩家', player.getName(), "触发事件", event.class.simpleName);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
// noinspection JSUnresolvedVariable
|
// noinspection JSUnresolvedVariable
|
||||||
player.sendMessage("§a欢迎来到 §bMiaoScript §a的世界! 当前在线: " + server.players.length)
|
player.sendMessage("§a欢迎来到 §bMiaoScript §a的世界! 当前在线: " + server.players().length)
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ var wrapper = require('api/wrapper')
|
|||||||
var command = require('api/command')
|
var command = require('api/command')
|
||||||
var manager = require('api/plugin')
|
var manager = require('api/plugin')
|
||||||
var task = require('api/task')
|
var task = require('api/task')
|
||||||
|
|
||||||
var http = require('http')
|
var http = require('http')
|
||||||
var fs = require('fs')
|
var fs = require('fs')
|
||||||
|
|
||||||
@ -61,12 +62,12 @@ function enable() {
|
|||||||
if (pkg) {
|
if (pkg) {
|
||||||
task.async(function install() {
|
task.async(function install() {
|
||||||
var pfile = fs.file(__dirname, pname + '.js')
|
var pfile = fs.file(__dirname, pname + '.js')
|
||||||
console.sender(sender, '§a开始下载插件: §b%s'.format(pkg.name))
|
console.sender(sender, '§6开始下载插件: §b%s'.format(pkg.name))
|
||||||
console.sender(sender, '§a插件下载地址: §b%s'.format(pkg.url))
|
console.sender(sender, '§6插件下载地址: §b%s'.format(pkg.url))
|
||||||
fs.save(pfile, http.get(pkg.url))
|
fs.save(pfile, http.get(pkg.url))
|
||||||
console.sender(sender, '§a插件 §b%s §a下载完毕 开始加载 ...'.format(pname))
|
console.sender(sender, '§6插件 §b%s §a下载完毕 开始加载 ...'.format(pname))
|
||||||
manager.loadPlugin(pfile)
|
manager.loadPlugin(pfile)
|
||||||
console.sender(sender, '§a插件 §b%s §a安装成功!'.format(pname))
|
console.sender(sender, '§6插件 §b%s §a安装成功!'.format(pname))
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log(sender, '§c插件 %s 不存在!'.format(pname))
|
console.log(sender, '§c插件 %s 不存在!'.format(pname))
|
||||||
|
Loading…
Reference in New Issue
Block a user