alpha: 初始版本完善

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
2017-09-23 17:42:16 +08:00
parent fdeb2619ff
commit 7c5ad40497
15 changed files with 680 additions and 27 deletions

View File

@ -0,0 +1,40 @@
/**
* Bukkit基础操作
* Created by 蒋天蓓 on 2017/2/9 0009.
*/
'use strict';
/*global Java, base, module, exports, require, __FILE__*/
var Bukkit = Java.type("org.bukkit.Bukkit");
exports.broadcast = function (message) {
Bukkit.broadcastMessage(message);
};
/**
* 执行名称
* @param player 玩家
* @param command 命令
*/
exports.command = function (player, command) {
Bukkit.dispatchCommand(player, command);
};
/**
* 执行控制台命令
* @param command 命令
*/
exports.console = function (command) {
exports.command(Bukkit.getConsoleSender(), command);
};
/**
* 玩家以OP权限执行命令
* @param player
* @param exper
*/
exports.opcommand = function (player, exper) {
var origin = player.isOp();
player.setOp(true);
try {
exports.command(player, exper);
} finally {
player.setOp(origin);
}
};