diff options
author | Linnea Gräf <nea@nea.moe> | 2024-07-24 02:22:30 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-07-24 02:22:30 +0200 |
commit | c7143936d7a1bf3ae49362049541b2d23b11ab8c (patch) | |
tree | 4e905377b8abf56d1a9e253543a6d3a251f9da82 /src/main/kotlin/moe/nea/firmament/util/item | |
parent | 4585a11434f44fa0900351825eb3ca38ce64f187 (diff) | |
download | firmament-c7143936d7a1bf3ae49362049541b2d23b11ab8c.tar.gz firmament-c7143936d7a1bf3ae49362049541b2d23b11ab8c.tar.bz2 firmament-c7143936d7a1bf3ae49362049541b2d23b11ab8c.zip |
Add essence upgrade recipes
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/item')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt b/src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt index ef22325..c33c47f 100644 --- a/src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt +++ b/src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt @@ -18,8 +18,11 @@ var ItemStack.loreAccordingToNbt set(DataComponentTypes.LORE, LoreComponent(value)) } -val ItemStack.displayNameAccordingToNbt +var ItemStack.displayNameAccordingToNbt: Text get() = get(DataComponentTypes.CUSTOM_NAME) ?: get(DataComponentTypes.ITEM_NAME) ?: item.name + set(value) { + set(DataComponentTypes.CUSTOM_NAME, value) + } fun ItemStack.setCustomName(text: Text) { set(DataComponentTypes.CUSTOM_NAME, text) |