diff --git a/common/src/main/java/io/github/moulberry/moulconfig/managed/GsonMapper.kt b/common/src/main/java/io/github/moulberry/moulconfig/managed/GsonMapper.kt index 39c701b20..72e98ba44 100644 --- a/common/src/main/java/io/github/moulberry/moulconfig/managed/GsonMapper.kt +++ b/common/src/main/java/io/github/moulberry/moulconfig/managed/GsonMapper.kt @@ -1,11 +1,14 @@ package io.github.moulberry.moulconfig.managed import com.google.gson.GsonBuilder +import io.github.moulberry.moulconfig.ChromaColour +import io.github.moulberry.moulconfig.LegacyStringChromaColourTypeAdapter import io.github.moulberry.moulconfig.observer.PropertyTypeAdapterFactory class GsonMapper(val clazz: Class) : DataMapper { val gsonBuilder = GsonBuilder() .registerTypeAdapterFactory(PropertyTypeAdapterFactory()) + .registerTypeAdapter(ChromaColour::class.java, LegacyStringChromaColourTypeAdapter(true)) private val gson by lazy { gsonBuilder.create() } override fun serialize(value: T): String { return gson.toJson(value)