use of com.oskarsmc.message.util.CloudSuggestionProcessor in project message by OskarsMC-Plugins.
the class Message method onProxyInitialization.
/**
* Initialise the plugin.
* @param event Proxy Initialise Event
*/
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
MessageSettings messageSettings = injector.getInstance(MessageSettings.class);
injector = injector.createChildInjector(new CloudInjectionModule<>(CommandSource.class, CommandExecutionCoordinator.simpleCoordinator(), Function.identity(), Function.identity()), new MessageModule(messageSettings));
injector.getInstance(TranslationManager.class);
if (messageSettings.enabled()) {
if (messageSettings.luckpermsIntegration()) {
if (DependencyChecker.luckperms()) {
logger.info("LuckPerms integration enabled. Targeted LuckPerms version 5.3, using " + LuckPermsProvider.get().getPluginMetadata().getVersion());
} else {
logger.warn("LuckPerms integration was enabled but LuckPerms was not detected on the proxy. Continuing without it.");
messageSettings.luckpermsIntegration(false);
}
}
// Allow autocompletion regardless of capitalisation
injector.getInstance(Key.get(new TypeLiteral<VelocityCommandManager<CommandSource>>() {
})).setCommandSuggestionProcessor(new CloudSuggestionProcessor());
// Commands
injector.getInstance(MessageCommand.class);
injector.getInstance(SocialSpyCommand.class);
injector.getInstance(ReplyCommand.class);
// Metrics
injector.getInstance(MessageMetrics.class);
}
logger.info("Loaded message " + getClass().getPackage().getImplementationVersion());
}
Aggregations