use of net.william278.huskchat.velocity.command.VelocityCommand in project HuskChat by WiIIiam278.
the class HuskChatVelocity method onProxyInitialization.
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
instance = this;
// Load config
reloadSettings();
// Load messages
reloadMessages();
// Setup player data getter
Optional<PluginContainer> luckPerms = getProxyServer().getPluginManager().getPlugin("luckperms");
if (luckPerms.isPresent()) {
playerDataGetter = new LuckPermsDataGetter();
} else {
playerDataGetter = new DefaultDataGetter();
}
// Register events
getProxyServer().getEventManager().register(this, new VelocityListener());
// Register commands
new VelocityCommand(new HuskChatCommand(this));
new VelocityCommand(new ChannelCommand(this));
if (Settings.doMessageCommand) {
new VelocityCommand(new MsgCommand(this));
new VelocityCommand(new ReplyCommand(this));
}
if (Settings.doBroadcastCommand) {
new VelocityCommand(new BroadcastCommand(this));
}
if (Settings.doSocialSpyCommand) {
new VelocityCommand(new SocialSpyCommand(this));
}
if (Settings.doLocalSpyCommand) {
new VelocityCommand(new LocalSpyCommand(this));
}
// Register shortcut commands
for (Channel channel : Settings.channels) {
for (String command : channel.shortcutCommands) {
new VelocityCommand(new ShortcutCommand(command, channel.id, this));
}
}
// Initialise metrics
metricsFactory.make(this, METRICS_ID);
// Plugin startup logic
getLoggingAdapter().info("Enabled HuskChat version " + getMetaVersion());
}
Aggregations