feat: add qrcode lib

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-07-23 13:44:39 +08:00
parent 63ff11def1
commit b400ab81f0
3 changed files with 1261 additions and 5 deletions

View File

@ -8,18 +8,30 @@ const Messenger = Bukkit.getMessenger()
@provideSingleton(channel.Channel)
export class BukkitChannel extends channel.Channel {
@inject(plugin.PluginInstance)
private pluginInstance: any;
private pluginInstance: any
send(player: any, channel: string, data: any) {
player.sendPluginMessage(this.pluginInstance, channel, data);
/**
*
* @param player
* @param channel
* @param data
*/
send(player: any, channel: string, data: number[]) {
player.sendPluginMessage(this.pluginInstance, channel, data)
}
/**
*
* @param channel
* @param listener
*/
register(channel: string, listener: channel.ChannelListener) {
Messenger.registerIncomingPluginChannel(this.pluginInstance, channel, new PluginMessageListener({
onPluginMessageReceived: (/**String */ channel, /**Player */ player, /**byte[] */data) => {
listener(data, { channel, player, data })
}
}));
Messenger.registerOutgoingPluginChannel(this.pluginInstance, channel);
}))
Messenger.registerOutgoingPluginChannel(this.pluginInstance, channel)
}
unregister(channel: string, listener: any) {
Messenger.unregisterIncomingPluginChannel(this.pluginInstance, channel)

File diff suppressed because it is too large Load Diff

View File

@ -73,6 +73,7 @@ declare global {
interface Console {
ex(err: Error): void
stack(err: Error, color?: boolean): string[]
sender(sender: any, ...args: any): void
sender(...args: any): void
console(...args: any): void
i18n(name: string, ...params: any[]): void