Search in sources :

Example 1 with ProxiedPlayerLocaleProvider

use of eu.okaeri.platform.bungee.i18n.ProxiedPlayerLocaleProvider in project okaeri-platform by OkaeriPoland.

the class OkaeriBungeePlugin method plan.

@Override
public void plan(@NonNull ExecutionPlan plan) {
    plan.add(PRE_SETUP, new InjectorSetupTask());
    plan.add(PRE_SETUP, (ExecutionTask<OkaeriBungeePlugin>) platform -> {
        platform.registerInjectable("proxy", platform.getProxy());
        platform.registerInjectable("dataFolder", platform.getDataFolder());
        platform.registerInjectable("jarFile", platform.getFile());
        platform.registerInjectable("logger", platform.getLogger());
        platform.registerInjectable("plugin", platform);
        platform.registerInjectable("placeholders", BungeePlaceholders.create(true));
        platform.registerInjectable("scheduler", new PlatformScheduler(platform, platform.getProxy().getScheduler()));
        platform.registerInjectable("pluginManager", platform.getProxy().getPluginManager());
        platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlBungeeConfigurer::new);
        platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesBungee.class });
        platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
        platform.registerInjectable("i18nLocaleProvider", new ProxiedPlayerLocaleProvider());
    });
    // plan.add(PRE_SETUP, new BungeeCommandsSetupTask()); TODO
    plan.add(SETUP, new CreatorSetupTask(BungeeComponentCreator.class, BungeeCreatorRegistry.class), "creator");
    plan.add(POST_SETUP, new BungeeExternalResourceProviderSetupTask());
    plan.add(POST_SETUP, new BeanManifestCreateTask());
    plan.add(POST_SETUP, new BeanManifestExecuteTask());
    plan.add(SHUTDOWN, new BungeeSchedulerShutdownTask());
    plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
Also used : Setter(lombok.Setter) Arrays(java.util.Arrays) Getter(lombok.Getter) ExecutionPlan(eu.okaeri.platform.core.plan.ExecutionPlan) Injector(eu.okaeri.injector.Injector) BungeeSchedulerShutdownTask(eu.okaeri.platform.bungee.plan.BungeeSchedulerShutdownTask) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) BungeePlaceholders(eu.okaeri.placeholders.bungee.BungeePlaceholders) YamlBungeeConfigurer(eu.okaeri.configs.yaml.bungee.YamlBungeeConfigurer) OkaeriPlatform(eu.okaeri.platform.core.OkaeriPlatform) ExecutionResult(eu.okaeri.platform.core.plan.ExecutionResult) ProxiedPlayerLocaleProvider(eu.okaeri.platform.bungee.i18n.ProxiedPlayerLocaleProvider) ExecutionTask(eu.okaeri.platform.core.plan.ExecutionTask) PlatformScheduler(eu.okaeri.platform.bungee.scheduler.PlatformScheduler) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) BungeeCreatorRegistry(eu.okaeri.platform.bungee.component.BungeeCreatorRegistry) NonNull(lombok.NonNull) ProxyServer(net.md_5.bungee.api.ProxyServer) BungeeExternalResourceProviderSetupTask(eu.okaeri.platform.bungee.plan.BungeeExternalResourceProviderSetupTask) PluginDescription(net.md_5.bungee.api.plugin.PluginDescription) BungeeComponentCreator(eu.okaeri.platform.bungee.component.BungeeComponentCreator) ComponentCreator(eu.okaeri.platform.core.component.creator.ComponentCreator) eu.okaeri.platform.core.plan.task(eu.okaeri.platform.core.plan.task) Plugin(net.md_5.bungee.api.plugin.Plugin) SerdesBungee(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBungee) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) ExecutionPhase(eu.okaeri.platform.core.plan.ExecutionPhase) BungeeComponentCreator(eu.okaeri.platform.bungee.component.BungeeComponentCreator) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) BungeeCreatorRegistry(eu.okaeri.platform.bungee.component.BungeeCreatorRegistry) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) ProxiedPlayerLocaleProvider(eu.okaeri.platform.bungee.i18n.ProxiedPlayerLocaleProvider) SerdesBungee(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBungee) BungeeExternalResourceProviderSetupTask(eu.okaeri.platform.bungee.plan.BungeeExternalResourceProviderSetupTask) YamlBungeeConfigurer(eu.okaeri.configs.yaml.bungee.YamlBungeeConfigurer) PlatformScheduler(eu.okaeri.platform.bungee.scheduler.PlatformScheduler) BungeeSchedulerShutdownTask(eu.okaeri.platform.bungee.plan.BungeeSchedulerShutdownTask)

Aggregations

SerdesCommons (eu.okaeri.configs.serdes.commons.SerdesCommons)1 SerdesBungee (eu.okaeri.configs.yaml.bukkit.serdes.SerdesBungee)1 YamlBungeeConfigurer (eu.okaeri.configs.yaml.bungee.YamlBungeeConfigurer)1 Injector (eu.okaeri.injector.Injector)1 ConfigurerProvider (eu.okaeri.persistence.document.ConfigurerProvider)1 BungeePlaceholders (eu.okaeri.placeholders.bungee.BungeePlaceholders)1 BungeeComponentCreator (eu.okaeri.platform.bungee.component.BungeeComponentCreator)1 BungeeCreatorRegistry (eu.okaeri.platform.bungee.component.BungeeCreatorRegistry)1 ProxiedPlayerLocaleProvider (eu.okaeri.platform.bungee.i18n.ProxiedPlayerLocaleProvider)1 BungeeExternalResourceProviderSetupTask (eu.okaeri.platform.bungee.plan.BungeeExternalResourceProviderSetupTask)1 BungeeSchedulerShutdownTask (eu.okaeri.platform.bungee.plan.BungeeSchedulerShutdownTask)1 PlatformScheduler (eu.okaeri.platform.bungee.scheduler.PlatformScheduler)1 OkaeriPlatform (eu.okaeri.platform.core.OkaeriPlatform)1 ComponentCreator (eu.okaeri.platform.core.component.creator.ComponentCreator)1 SimplePlaceholdersFactory (eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory)1 ExecutionPhase (eu.okaeri.platform.core.plan.ExecutionPhase)1 ExecutionPlan (eu.okaeri.platform.core.plan.ExecutionPlan)1 ExecutionResult (eu.okaeri.platform.core.plan.ExecutionResult)1 ExecutionTask (eu.okaeri.platform.core.plan.ExecutionTask)1 eu.okaeri.platform.core.plan.task (eu.okaeri.platform.core.plan.task)1