Skip to content

Commit

Permalink
text: fix translation insertion with intarray (nbt)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bixilon committed Feb 29, 2024
1 parent 40b22db commit e5c2d79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/de/bixilon/minosoft/data/text/BaseComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5c2d79

Please # to comment.