Search in sources :

Example 1 with BungeeListener

use of com.github.games647.fastlogin.bukkit.listener.BungeeListener in project FastLogin by games647.

the class BungeeManager method registerPluginChannels.

private void registerPluginChannels() {
    Server server = Bukkit.getServer();
    // check for incoming messages from the bungeecord version of this plugin
    String groupId = plugin.getName();
    String forceChannel = NamespaceKey.getCombined(groupId, LoginActionMessage.FORCE_CHANNEL);
    server.getMessenger().registerIncomingPluginChannel(plugin, forceChannel, new BungeeListener(plugin));
    // outgoing
    String successChannel = new NamespaceKey(groupId, SUCCESS_CHANNEL).getCombinedName();
    String changeChannel = new NamespaceKey(groupId, CHANGE_CHANNEL).getCombinedName();
    server.getMessenger().registerOutgoingPluginChannel(plugin, successChannel);
    server.getMessenger().registerOutgoingPluginChannel(plugin, changeChannel);
}
Also used : NamespaceKey(com.github.games647.fastlogin.core.message.NamespaceKey) Server(org.bukkit.Server) BungeeListener(com.github.games647.fastlogin.bukkit.listener.BungeeListener)

Aggregations

BungeeListener (com.github.games647.fastlogin.bukkit.listener.BungeeListener)1 NamespaceKey (com.github.games647.fastlogin.core.message.NamespaceKey)1 Server (org.bukkit.Server)1