mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 01:16:46 -04:00
entity event data: allow lenient json
This commit is contained in:
parent
ae3bfef853
commit
95733e5d06
@ -41,7 +41,7 @@ data class EntityHoverEvent(
|
||||
}
|
||||
json["text"]?.let {
|
||||
// 1.14.3.... lol
|
||||
json = Jackson.MAPPER.readValue(it.unsafeCast<String>(), Jackson.JSON_MAP_TYPE)
|
||||
json = Jackson.MAPPER_LENIENT.readValue(it.unsafeCast<String>(), Jackson.JSON_MAP_TYPE)
|
||||
}
|
||||
var type: ResourceLocation? = null
|
||||
json["type"]?.nullCast<String>()?.let {
|
||||
|
@ -56,6 +56,8 @@ object Jackson {
|
||||
propertyNamingStrategy = PropertyNamingStrategies.SNAKE_CASE
|
||||
}
|
||||
|
||||
val MAPPER_LENIENT = MAPPER.copy().apply { enable(JsonReadFeature.ALLOW_UNQUOTED_FIELD_NAMES.mappedFeature()) }
|
||||
|
||||
|
||||
val JSON_MAP_TYPE: MapType = MAPPER.typeFactory.constructMapType(HashMap::class.java, Any::class.java, Any::class.java)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user