diff options
author | Linnea Gräf <nea@nea.moe> | 2024-01-21 14:06:34 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-01-21 14:06:34 +0100 |
commit | 3e1f75e32253bca3312f478a60d315bec37bc112 (patch) | |
tree | 14260e41bd2d8669d6d3ffa9a9a30d1d9ee2fe6c /src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt | |
parent | 18ebd21cb0f97dea8367e65002e0bf32e5c686e2 (diff) | |
download | firmament-3e1f75e32253bca3312f478a60d315bec37bc112.tar.gz firmament-3e1f75e32253bca3312f478a60d315bec37bc112.tar.bz2 firmament-3e1f75e32253bca3312f478a60d315bec37bc112.zip |
Bump to 1.20.4
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt b/src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt index cccff64..4f8c90c 100644 --- a/src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt @@ -17,17 +17,17 @@ fun ItemStack.appendLore(args: List<Text>) { val compoundTag = getOrCreateSubNbt("display") val loreList = compoundTag.getOrCreateList("Lore", NbtString.STRING_TYPE) for (arg in args) { - loreList.add(NbtString.of(Text.Serializer.toJson(arg))) + loreList.add(NbtString.of(Text.Serialization.toJsonString(arg))) } } fun ItemStack.modifyLore(update: (List<Text>) -> List<Text>) { val compoundTag = getOrCreateSubNbt("display") val loreList = compoundTag.getOrCreateList("Lore", NbtString.STRING_TYPE) - val parsed = loreList.map { Text.Serializer.fromJson(it.asString())!! } + val parsed = loreList.map { Text.Serialization.fromJson(it.asString())!! } val updated = update(parsed) loreList.clear() - loreList.addAll(updated.map { NbtString.of(Text.Serializer.toJson(it)) }) + loreList.addAll(updated.map { NbtString.of(Text.Serialization.toJsonString(it)) }) } |