use of io.github.nucleuspowered.nucleus.core.configurate.typeserialisers.NamedLocationSerialiser in project Nucleus by NucleusPowered.
the class ConfigurateHelper method setupCore.
private static TypeSerializerCollection setupCore(final INucleusServiceCollection serviceCollection, final ObjectMapper.Factory factory, final ConfigurationOptions options) {
final TypeSerializerCollection.Builder typeSerializerCollection = options.serializers().childBuilder();
// Custom type serialisers for Nucleus
typeSerializerCollection.registerAnnotatedObjects(factory);
typeSerializerCollection.register(TypeToken.get(Vector3d.class), new Vector3dTypeSerialiser());
typeSerializerCollection.register(TypeToken.get(Pattern.class), new PatternTypeSerialiser());
typeSerializerCollection.register(TypeToken.get(NucleusTextTemplate.class), new NucleusTextTemplateTypeSerialiser(serviceCollection.textTemplateFactory()));
typeSerializerCollection.register(TypeToken.get(Instant.class), new InstantTypeSerialiser());
typeSerializerCollection.register(TypeTokens.NAMED_LOCATION, new NamedLocationSerialiser());
typeSerializerCollection.register(TypeTokens.LOCALE, new LocaleSerialiser());
return typeSerializerCollection.build();
}
Aggregations