Search in sources :

Example 1 with BukkitExternalResourceProviderSetupTask

use of eu.okaeri.platform.bukkit.plan.BukkitExternalResourceProviderSetupTask in project okaeri-platform by OkaeriPoland.

the class OkaeriBukkitPlugin method plan.

@Override
public void plan(@NonNull ExecutionPlan plan) {
    plan.add(PRE_SETUP, new InjectorSetupTask());
    plan.add(PRE_SETUP, (ExecutionTask<OkaeriBukkitPlugin>) platform -> {
        platform.registerInjectable("server", platform.getServer());
        platform.registerInjectable("dataFolder", platform.getDataFolder());
        platform.registerInjectable("jarFile", platform.getFile());
        platform.registerInjectable("logger", platform.getLogger());
        platform.registerInjectable("plugin", platform);
        platform.registerInjectable("placeholders", BukkitPlaceholders.create(true));
        platform.registerInjectable("scheduler", new PlatformScheduler(platform, platform.getServer().getScheduler()));
        platform.registerInjectable("tasker", BukkitTasker.newPool(platform));
        platform.registerInjectable("pluginManager", platform.getServer().getPluginManager());
        platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlBukkitConfigurer::new);
        platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesBukkit.class });
        platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
        platform.registerInjectable("i18nLocaleProvider", new PlayerLocaleProvider());
        platform.registerInjectable("guardian", ReflectGuardian.create(ReflectPlaceholders.create()));
    });
    plan.add(SETUP, new BukkitCommandsSetupTask());
    plan.add(SETUP, new CreatorSetupTask(BukkitComponentCreator.class, BukkitCreatorRegistry.class));
    plan.add(POST_SETUP, new BukkitExternalResourceProviderSetupTask());
    plan.add(POST_SETUP, new BeanManifestCreateTask());
    plan.add(POST_SETUP, new BukkitCommandsI18nManifestTask());
    plan.add(POST_SETUP, new BeanManifestExecuteTask());
    plan.add(POST_SETUP, new CommandsI18nSetupTask());
    plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
Also used : Setter(lombok.Setter) Arrays(java.util.Arrays) BukkitExternalResourceProviderSetupTask(eu.okaeri.platform.bukkit.plan.BukkitExternalResourceProviderSetupTask) Getter(lombok.Getter) ExecutionPlan(eu.okaeri.platform.core.plan.ExecutionPlan) Injector(eu.okaeri.injector.Injector) ReflectPlaceholders(eu.okaeri.placeholders.reflect.ReflectPlaceholders) BukkitComponentCreator(eu.okaeri.platform.bukkit.component.BukkitComponentCreator) BukkitPlaceholders(eu.okaeri.placeholders.bukkit.BukkitPlaceholders) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) OkaeriPlatform(eu.okaeri.platform.core.OkaeriPlatform) ExecutionResult(eu.okaeri.platform.core.plan.ExecutionResult) BukkitTasker(eu.okaeri.tasker.bukkit.BukkitTasker) ReflectGuardian(eu.okaeri.acl.reflect.ReflectGuardian) PlatformScheduler(eu.okaeri.platform.bukkit.scheduler.PlatformScheduler) ExecutionTask(eu.okaeri.platform.core.plan.ExecutionTask) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) BukkitCreatorRegistry(eu.okaeri.platform.bukkit.component.BukkitCreatorRegistry) NonNull(lombok.NonNull) PlayerLocaleProvider(eu.okaeri.platform.bukkit.i18n.PlayerLocaleProvider) YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) SerdesBukkit(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit) File(java.io.File) JavaPlugin(org.bukkit.plugin.java.JavaPlugin) BukkitCommandsI18nManifestTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsI18nManifestTask) ComponentCreator(eu.okaeri.platform.core.component.creator.ComponentCreator) JavaPluginLoader(org.bukkit.plugin.java.JavaPluginLoader) eu.okaeri.platform.core.plan.task(eu.okaeri.platform.core.plan.task) CommandsI18nSetupTask(eu.okaeri.platform.minecraft.task.CommandsI18nSetupTask) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) BukkitCommandsSetupTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsSetupTask) PluginDescriptionFile(org.bukkit.plugin.PluginDescriptionFile) ExecutionPhase(eu.okaeri.platform.core.plan.ExecutionPhase) BukkitExternalResourceProviderSetupTask(eu.okaeri.platform.bukkit.plan.BukkitExternalResourceProviderSetupTask) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) PlayerLocaleProvider(eu.okaeri.platform.bukkit.i18n.PlayerLocaleProvider) YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) BukkitComponentCreator(eu.okaeri.platform.bukkit.component.BukkitComponentCreator) BukkitCommandsI18nManifestTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsI18nManifestTask) CommandsI18nSetupTask(eu.okaeri.platform.minecraft.task.CommandsI18nSetupTask) SerdesBukkit(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit) BukkitCommandsSetupTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsSetupTask) BukkitCreatorRegistry(eu.okaeri.platform.bukkit.component.BukkitCreatorRegistry) PlatformScheduler(eu.okaeri.platform.bukkit.scheduler.PlatformScheduler)

Aggregations

ReflectGuardian (eu.okaeri.acl.reflect.ReflectGuardian)1 SerdesCommons (eu.okaeri.configs.serdes.commons.SerdesCommons)1 YamlBukkitConfigurer (eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer)1 SerdesBukkit (eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit)1 Injector (eu.okaeri.injector.Injector)1 ConfigurerProvider (eu.okaeri.persistence.document.ConfigurerProvider)1 BukkitPlaceholders (eu.okaeri.placeholders.bukkit.BukkitPlaceholders)1 ReflectPlaceholders (eu.okaeri.placeholders.reflect.ReflectPlaceholders)1 BukkitComponentCreator (eu.okaeri.platform.bukkit.component.BukkitComponentCreator)1 BukkitCreatorRegistry (eu.okaeri.platform.bukkit.component.BukkitCreatorRegistry)1 PlayerLocaleProvider (eu.okaeri.platform.bukkit.i18n.PlayerLocaleProvider)1 BukkitCommandsI18nManifestTask (eu.okaeri.platform.bukkit.plan.BukkitCommandsI18nManifestTask)1 BukkitCommandsSetupTask (eu.okaeri.platform.bukkit.plan.BukkitCommandsSetupTask)1 BukkitExternalResourceProviderSetupTask (eu.okaeri.platform.bukkit.plan.BukkitExternalResourceProviderSetupTask)1 PlatformScheduler (eu.okaeri.platform.bukkit.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