feat: add nukkit support

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-02-24 04:02:29 +08:00
parent 0fbccbc05f
commit 19e7692756
3 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@ms/bukkit",
"version": "0.2.0",
"description": "MiaoScript api package",
"description": "MiaoScript bukkit package",
"keywords": [
"miaoscript",
"minecraft",

View File

@ -19,7 +19,6 @@ export class BukkitCommand extends command.Command {
init() {
this.commandMap = reflect.on(Bukkit.getPluginManager()).get('commandMap').get();
}
create(plugin: any, command: string) {
var cmd = this.commandMap.getCommand(command)
if (cmd && cmd instanceof PluginCommand) { return cmd };

View File

@ -61,6 +61,11 @@ function detectServer() {
return 'sponge'
} catch (ex) {
}
try {
Java.type("cn.nukkit.Nukkit");
return 'nukkit'
} catch (ex) {
}
try {
Java.type("net.md_5.bungee.api.ProxyServer");
return 'bungee'