Search in sources :

Example 1 with ConnectListener

use of com.github.games647.changeskin.bungee.listener.ConnectListener in project ChangeSkin by games647.

the class ChangeSkinBungee method onEnable.

@Override
public void onEnable() {
    logger = CommonUtil.createLoggerFromJDK(getLogger());
    core = new ChangeSkinCore(this);
    try {
        core.load(true);
    } catch (Exception ioExc) {
        logger.error("Error initializing plugin. Disabling...", ioExc);
        return;
    }
    PluginManager pluginManager = getProxy().getPluginManager();
    pluginManager.registerListener(this, new ConnectListener(this));
    pluginManager.registerListener(this, new ServerSwitchListener(this));
    // this is required to listen to messages from the server
    getProxy().registerChannel(getName());
    pluginManager.registerListener(this, new MessageListener(this));
    // register commands
    pluginManager.registerCommand(this, new SetCommand(this));
    pluginManager.registerCommand(this, new InvalidateCommand(this));
    pluginManager.registerCommand(this, new UploadCommand(this));
    pluginManager.registerCommand(this, new SelectCommand(this));
    pluginManager.registerCommand(this, new InfoCommand(this));
}
Also used : PluginManager(net.md_5.bungee.api.plugin.PluginManager) ChangeSkinCore(com.github.games647.changeskin.core.ChangeSkinCore) ServerSwitchListener(com.github.games647.changeskin.bungee.listener.ServerSwitchListener) UploadCommand(com.github.games647.changeskin.bungee.command.UploadCommand) InfoCommand(com.github.games647.changeskin.bungee.command.InfoCommand) MessageListener(com.github.games647.changeskin.bungee.listener.MessageListener) SelectCommand(com.github.games647.changeskin.bungee.command.SelectCommand) ConnectListener(com.github.games647.changeskin.bungee.listener.ConnectListener) InvalidateCommand(com.github.games647.changeskin.bungee.command.InvalidateCommand) SetCommand(com.github.games647.changeskin.bungee.command.SetCommand)

Aggregations

InfoCommand (com.github.games647.changeskin.bungee.command.InfoCommand)1 InvalidateCommand (com.github.games647.changeskin.bungee.command.InvalidateCommand)1 SelectCommand (com.github.games647.changeskin.bungee.command.SelectCommand)1 SetCommand (com.github.games647.changeskin.bungee.command.SetCommand)1 UploadCommand (com.github.games647.changeskin.bungee.command.UploadCommand)1 ConnectListener (com.github.games647.changeskin.bungee.listener.ConnectListener)1 MessageListener (com.github.games647.changeskin.bungee.listener.MessageListener)1 ServerSwitchListener (com.github.games647.changeskin.bungee.listener.ServerSwitchListener)1 ChangeSkinCore (com.github.games647.changeskin.core.ChangeSkinCore)1 PluginManager (net.md_5.bungee.api.plugin.PluginManager)1