Search in sources :

Example 1 with DynamicListenerManager

use of net.dzikoysk.funnyguilds.listener.dynamic.DynamicListenerManager in project FunnyGuilds by FunnyGuilds.

the class FunnyGuilds method onLoad.

@Override
public void onLoad() {
    plugin = this;
    logger = new FunnyGuildsLogger(this);
    this.version = new FunnyGuildsVersion(this);
    try {
        Class.forName("net.md_5.bungee.api.ChatColor");
    } catch (Exception spigotNeeded) {
        logger.error("FunnyGuilds requires spigot to work, your server seems to be using something else");
        logger.error("If you think that is not true - contact plugin developers");
        logger.error("https://github.com/FunnyGuilds/FunnyGuilds");
        shutdown("Spigot required for service not detected!");
        return;
    }
    if (!this.getDataFolder().exists()) {
        this.getDataFolder().mkdir();
    }
    this.nmsAccessor = this.prepareNmsAccessor();
    try {
        ConfigurationFactory configurationFactory = new ConfigurationFactory();
        this.messageConfiguration = configurationFactory.createMessageConfiguration(messageConfigurationFile);
        this.pluginConfiguration = configurationFactory.createPluginConfiguration(pluginConfigurationFile);
        this.tablistConfiguration = configurationFactory.createTablistConfiguration(tablistConfigurationFile);
    } catch (Exception exception) {
        logger.error("Could not load plugin configuration", exception);
        shutdown("Critical error has been encountered!");
        return;
    }
    DescriptionChanger descriptionChanger = new DescriptionChanger(super.getDescription());
    descriptionChanger.rename(pluginConfiguration.pluginName);
    this.concurrencyManager = new ConcurrencyManager(this, pluginConfiguration.concurrencyThreads);
    this.concurrencyManager.printStatus();
    this.dynamicListenerManager = new DynamicListenerManager(this);
    this.hookManager = new HookManager(plugin);
    this.hookManager.setupEarlyHooks();
    this.hookManager.earlyInit();
}
Also used : ConcurrencyManager(net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager) DescriptionChanger(net.dzikoysk.funnyguilds.nms.DescriptionChanger) ConfigurationFactory(net.dzikoysk.funnyguilds.config.ConfigurationFactory) DynamicListenerManager(net.dzikoysk.funnyguilds.listener.dynamic.DynamicListenerManager) OkaeriException(eu.okaeri.configs.exception.OkaeriException) HookManager(net.dzikoysk.funnyguilds.feature.hooks.HookManager)

Aggregations

OkaeriException (eu.okaeri.configs.exception.OkaeriException)1 ConcurrencyManager (net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager)1 ConfigurationFactory (net.dzikoysk.funnyguilds.config.ConfigurationFactory)1 HookManager (net.dzikoysk.funnyguilds.feature.hooks.HookManager)1 DynamicListenerManager (net.dzikoysk.funnyguilds.listener.dynamic.DynamicListenerManager)1 DescriptionChanger (net.dzikoysk.funnyguilds.nms.DescriptionChanger)1