diff --git a/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigDeserializer.kt b/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigDeserializer.kt index 7aa9b5b..f0dac2b 100644 --- a/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigDeserializer.kt +++ b/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigDeserializer.kt @@ -34,7 +34,7 @@ class JanksonConfigDeserializer: ConfigDeserializer { override fun tryDeserialize(e: JsonElement, rClass: KClass): R? { if (e is JsonPrimitive) { val any = when (val value = e.value) { - is Char, is Double, is Long -> value + is Char, is Double, is Long, is Boolean -> value is Byte, is Short, is Int -> (value as Number).toLong() is Float -> value.toDouble() is String -> if (rClass == Identifier::class) Identifier.tryParse(value) else value diff --git a/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigSerializer.kt b/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigSerializer.kt index 9680688..b393d95 100644 --- a/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigSerializer.kt +++ b/src/main/java/redstoneparadox/paradoxconfig/serialization/jankson/JanksonConfigSerializer.kt @@ -17,7 +17,7 @@ class JanksonConfigSerializer: ConfigSerializer { override fun trySerialize(value: Any): JsonElement? { return when (value) { - is String, is Char, is Byte, is Short, is Int, is Long, is Float, is Double -> JsonPrimitive(value) + is String, is Char, is Byte, is Short, is Int, is Long, is Float, is Double, is Boolean -> JsonPrimitive(value) is Identifier -> JsonPrimitive(value.toString()) else -> null }