text: fix translation insertion with intarray (nbt)

This commit is contained in:
Moritz Zwerger 2024-02-29 23:44:08 +01:00
parent 40b22db83a
commit e5c2d79f17
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -266,7 +266,8 @@ class BaseComponent : ChatComponent, Iterable<ChatComponent> {
}
private fun JsonObject.with(translator: Translator?, parent: TextComponent, restricted: Boolean): Array<ChatComponent>? {
val with = this["with"]?.toJsonList() ?: return null
val raw = this["with"]
val with = raw?.toJsonList()?.iterator() ?: raw.nullCast<IntArray>()?.iterator() ?: return null
val parts: MutableList<ChatComponent> = mutableListOf()
for (part in with) {
if (part == null) continue