Search in sources :

Example 1 with EntityTypeTransformer

use of net.dzikoysk.funnyguilds.config.serdes.EntityTypeTransformer in project FunnyGuilds by FunnyGuilds.

the class ConfigurationFactory method createPluginConfiguration.

public PluginConfiguration createPluginConfiguration(File pluginConfigurationFile) {
    return ConfigManager.create(PluginConfiguration.class, (it) -> {
        it.withConfigurer(new OkaeriValidator(new YamlBukkitConfigurer(), true), new SerdesCommons());
        it.withSerdesPack(registry -> {
            registry.register(new RawStringTransformer());
            registry.register(new MaterialTransformer());
            registry.register(new ItemStackTransformer());
            registry.register(new EntityTypeTransformer());
            registry.register(new FunnyTimeTransformer());
            registry.register(new RangeFormattingTransformer());
            registry.register(new VectorSerializer());
        });
        it.withBindFile(pluginConfigurationFile);
        it.withLogger(FunnyGuilds.getInstance().getLogger());
        it.saveDefaults();
        it.load(true);
        it.migrate(new P0001_Fix_freecam_compensation_key_case(), new P0002_Migrate_old_heart_configuration(), new P0003_Migrate_old_tnt_protection_configuration(), new P0004_Migrate_tablist_into_separate_file(), new P0005_Fix_heart_configuration_centery_key());
    });
}
Also used : ItemStackTransformer(net.dzikoysk.funnyguilds.config.serdes.ItemStackTransformer) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) P0004_Migrate_tablist_into_separate_file(net.dzikoysk.funnyguilds.config.migration.P0004_Migrate_tablist_into_separate_file) FunnyTimeTransformer(net.dzikoysk.funnyguilds.config.serdes.FunnyTimeTransformer) RawStringTransformer(net.dzikoysk.funnyguilds.config.serdes.RawStringTransformer) YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) P0001_Fix_freecam_compensation_key_case(net.dzikoysk.funnyguilds.config.migration.P0001_Fix_freecam_compensation_key_case) P0003_Migrate_old_tnt_protection_configuration(net.dzikoysk.funnyguilds.config.migration.P0003_Migrate_old_tnt_protection_configuration) EntityTypeTransformer(net.dzikoysk.funnyguilds.config.serdes.EntityTypeTransformer) RangeFormattingTransformer(net.dzikoysk.funnyguilds.config.serdes.RangeFormattingTransformer) VectorSerializer(net.dzikoysk.funnyguilds.config.serdes.VectorSerializer) P0002_Migrate_old_heart_configuration(net.dzikoysk.funnyguilds.config.migration.P0002_Migrate_old_heart_configuration) MaterialTransformer(net.dzikoysk.funnyguilds.config.serdes.MaterialTransformer) P0005_Fix_heart_configuration_centery_key(net.dzikoysk.funnyguilds.config.migration.P0005_Fix_heart_configuration_centery_key) OkaeriValidator(eu.okaeri.configs.validator.okaeri.OkaeriValidator)

Aggregations

SerdesCommons (eu.okaeri.configs.serdes.commons.SerdesCommons)1 OkaeriValidator (eu.okaeri.configs.validator.okaeri.OkaeriValidator)1 YamlBukkitConfigurer (eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer)1 P0001_Fix_freecam_compensation_key_case (net.dzikoysk.funnyguilds.config.migration.P0001_Fix_freecam_compensation_key_case)1 P0002_Migrate_old_heart_configuration (net.dzikoysk.funnyguilds.config.migration.P0002_Migrate_old_heart_configuration)1 P0003_Migrate_old_tnt_protection_configuration (net.dzikoysk.funnyguilds.config.migration.P0003_Migrate_old_tnt_protection_configuration)1 P0004_Migrate_tablist_into_separate_file (net.dzikoysk.funnyguilds.config.migration.P0004_Migrate_tablist_into_separate_file)1 P0005_Fix_heart_configuration_centery_key (net.dzikoysk.funnyguilds.config.migration.P0005_Fix_heart_configuration_centery_key)1 EntityTypeTransformer (net.dzikoysk.funnyguilds.config.serdes.EntityTypeTransformer)1 FunnyTimeTransformer (net.dzikoysk.funnyguilds.config.serdes.FunnyTimeTransformer)1 ItemStackTransformer (net.dzikoysk.funnyguilds.config.serdes.ItemStackTransformer)1 MaterialTransformer (net.dzikoysk.funnyguilds.config.serdes.MaterialTransformer)1 RangeFormattingTransformer (net.dzikoysk.funnyguilds.config.serdes.RangeFormattingTransformer)1 RawStringTransformer (net.dzikoysk.funnyguilds.config.serdes.RawStringTransformer)1 VectorSerializer (net.dzikoysk.funnyguilds.config.serdes.VectorSerializer)1