use of eu.okaeri.platform.core.plan.ExecutionTask 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());
}
use of eu.okaeri.platform.core.plan.ExecutionTask in project okaeri-platform by OkaeriPoland.
the class OkaeriWebApplication method plan.
@Override
public void plan(@NonNull ExecutionPlan plan) {
plan.add(PRE_SETUP, new InjectorSetupTask());
plan.add(PRE_SETUP, (ExecutionTask<OkaeriWebApplication>) platform -> {
platform.registerInjectable("dataFolder", platform.getDataFolder());
platform.registerInjectable("jarFile", platform.getFile());
platform.registerInjectable("logger", platform.getLogger());
platform.registerInjectable("app", platform);
platform.registerInjectable("javalin", platform.getJavalin());
platform.registerInjectable("jetty", Objects.requireNonNull(platform.getJavalin().jettyServer()));
platform.registerInjectable("placeholders", Placeholders.create(true));
platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlSnakeYamlConfigurer::new);
platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesWeb.class });
platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
platform.registerInjectable("i18nLocaleProvider", new SystemLocaleProvider());
});
plan.add(SETUP, new CommandsSetupTask(new OkaeriCommands()));
plan.add(SETUP, new CreatorSetupTask(ApplicationComponentCreator.class, WebCreatorRegistry.class));
plan.add(POST_SETUP, new BeanManifestCreateTask());
plan.add(POST_SETUP, new BeanManifestExecuteTask());
plan.add(POST_SETUP, new JavalinSetupTask());
plan.add(POST_SETUP, new PlatformBannerStartupTask());
plan.add(STARTUP, new JavalinStartTask());
plan.add(SHUTDOWN, new JavalinShutdownTask());
plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
use of eu.okaeri.platform.core.plan.ExecutionTask 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());
}
Aggregations