use of net.william278.huskchat.bungeecord.listener.BungeeListener in project HuskChat by WiIIiam278.
the class HuskChatBungee method onEnable.
@Override
public void onEnable() {
// Load config
reloadSettings();
// Load messages
reloadMessages();
// Setup player data getter
Plugin luckPerms = ProxyServer.getInstance().getPluginManager().getPlugin("LuckPerms");
if (luckPerms != null) {
playerDataGetter = new LuckPermsDataGetter();
} else {
Plugin bungeePerms = ProxyServer.getInstance().getPluginManager().getPlugin("BungeePerms");
if (bungeePerms != null) {
playerDataGetter = new BungeePermsDataGetter();
} else {
playerDataGetter = new DefaultDataGetter();
}
}
// Register events
getProxy().getPluginManager().registerListener(this, new BungeeListener());
// Register commands
new BungeeCommand(new HuskChatCommand(this));
new BungeeCommand(new ChannelCommand(this));
if (Settings.doMessageCommand) {
new BungeeCommand(new MsgCommand(this));
new BungeeCommand(new ReplyCommand(this));
}
if (Settings.doBroadcastCommand) {
new BungeeCommand(new BroadcastCommand(this));
}
if (Settings.doSocialSpyCommand) {
new BungeeCommand(new SocialSpyCommand(this));
}
if (Settings.doLocalSpyCommand) {
new BungeeCommand(new LocalSpyCommand(this));
}
// Register shortcut commands
for (Channel channel : Settings.channels) {
for (String command : channel.shortcutCommands) {
new BungeeCommand(new ShortcutCommand(command, channel.id, this));
}
}
// Initialise metrics
new Metrics(this, METRICS_ID);
// Plugin startup logic
getLogger().info("Enabled HuskChat version " + getDescription().getVersion());
}
Aggregations