Search in sources :

Example 1 with SimpleDateFormatTransformer

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

the class ConfigurationFactory method createMessageConfiguration.

public MessageConfiguration createMessageConfiguration(File messageConfigurationFile) {
    return ConfigManager.create(MessageConfiguration.class, (it) -> {
        it.withConfigurer(new YamlBukkitConfigurer());
        it.withSerdesPack(registry -> {
            registry.register(new DecolorTransformer());
            registry.register(new SimpleDateFormatTransformer());
        });
        it.withBindFile(messageConfigurationFile);
        it.saveDefaults();
        it.load(true);
    });
}
Also used : YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) SimpleDateFormatTransformer(net.dzikoysk.funnyguilds.config.serdes.SimpleDateFormatTransformer) DecolorTransformer(net.dzikoysk.funnyguilds.config.serdes.DecolorTransformer)

Aggregations

YamlBukkitConfigurer (eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer)1 DecolorTransformer (net.dzikoysk.funnyguilds.config.serdes.DecolorTransformer)1 SimpleDateFormatTransformer (net.dzikoysk.funnyguilds.config.serdes.SimpleDateFormatTransformer)1