diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/data/Codec2Serializer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/data/Codec2Serializer.kt index dec230f36..f42659e5e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/data/Codec2Serializer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/data/Codec2Serializer.kt @@ -32,6 +32,10 @@ class Codec2Serializer(val codec: Codec, val embed: Boolean = true) } override fun deserialize(p_79323_: JsonObject, p_79324_: JsonDeserializationContext): T { - return codec.fromJsonStrict(p_79323_["value"] ?: throw JsonSyntaxException("Missing 'value' element")) + if (embed) { + return codec.fromJsonStrict(p_79323_) + } else { + return codec.fromJsonStrict(p_79323_["value"] ?: throw JsonSyntaxException("Missing 'value' element")) + } } }