Search in sources :

Example 1 with NumberRangeTransformer

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

the class ConfigurationFactory method createTablistConfiguration.

public TablistConfiguration createTablistConfiguration(File tablistConfigurationFile) {
    return ConfigManager.create(TablistConfiguration.class, (it) -> {
        it.withConfigurer(new OkaeriValidator(new YamlBukkitConfigurer(), true), new SerdesCommons());
        it.withSerdesPack(registry -> {
            registry.register(new NumberRangeTransformer());
            registry.register(new TablistPageSerializer());
            registry.register(new SkinTextureSerializer());
        });
        it.withBindFile(tablistConfigurationFile);
        it.saveDefaults();
        it.load(true);
        it.migrate(new T0001_Update_player_list_animated());
    });
}
Also used : YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) T0001_Update_player_list_animated(net.dzikoysk.funnyguilds.config.migration.T0001_Update_player_list_animated) SkinTextureSerializer(net.dzikoysk.funnyguilds.config.serdes.SkinTextureSerializer) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) NumberRangeTransformer(net.dzikoysk.funnyguilds.config.serdes.NumberRangeTransformer) TablistPageSerializer(net.dzikoysk.funnyguilds.config.tablist.TablistPageSerializer) 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 T0001_Update_player_list_animated (net.dzikoysk.funnyguilds.config.migration.T0001_Update_player_list_animated)1 NumberRangeTransformer (net.dzikoysk.funnyguilds.config.serdes.NumberRangeTransformer)1 SkinTextureSerializer (net.dzikoysk.funnyguilds.config.serdes.SkinTextureSerializer)1 TablistPageSerializer (net.dzikoysk.funnyguilds.config.tablist.TablistPageSerializer)1