From 64523821d82d702c0bf2d62bbe45a1047aed8bda Mon Sep 17 00:00:00 2001 From: nea Date: Wed, 4 Oct 2023 16:41:04 +0200 Subject: Block selling to NPCs, trading and salvaging UUID locked items [no changelog] --- src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/moe/nea/firmament/util') 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 ac30771..ff3e09d 100644 --- a/src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt +++ b/src/main/kotlin/moe/nea/firmament/util/item/NbtItemData.kt @@ -11,9 +11,13 @@ import net.minecraft.nbt.NbtElement import net.minecraft.nbt.NbtString import net.minecraft.text.Text +fun textFromNbt() { + +} + val ItemStack.loreAccordingToNbt get() = getOrCreateSubNbt(ItemStack.DISPLAY_KEY).getList(ItemStack.LORE_KEY, NbtElement.STRING_TYPE.toInt()) - .map { Text.Serializer.fromJson((it as NbtString).asString()) } + .map { lazy(LazyThreadSafetyMode.NONE) { Text.Serializer.fromJson((it as NbtString).asString()) } } val ItemStack.displayNameAccordingToNbt get() = getOrCreateSubNbt(ItemStack.DISPLAY_KEY).let { -- cgit