feat: add channel support for bungee bukkit sponge

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-02-24 18:36:08 +08:00
parent 8616c3fe22
commit c996fa6873
9 changed files with 153 additions and 4 deletions

View File

@ -0,0 +1,18 @@
import { channel, plugin, event } from '@ms/api'
import { inject, injectable } from '@ms/container'
const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy()
@injectable()
export class BungeeChannel extends channel.Channel {
send(player: any, channel: string, data: any) {
throw new Error("Method not implemented.");
}
register(channel: string, listener: channel.ChannelListener) {
Bungee.registerChannel(channel);
console.console('§6[§eWARN§6] §eBungeeCord Channel only registerChannel you need self hanler PluginMessageEvent!')
}
unregister(channel: string, listener: any) {
Bungee.unregisterChannel(channel);
}
}