From c405a779bb12dd8e07d85623ce5e1e2ad903afe1 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 18 Apr 2024 13:25:38 +0200 Subject: Add dungeon chest opening event --- src/main/kotlin/moe/nea/ledger/ItemUtil.kt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/kotlin/moe/nea/ledger/ItemUtil.kt') diff --git a/src/main/kotlin/moe/nea/ledger/ItemUtil.kt b/src/main/kotlin/moe/nea/ledger/ItemUtil.kt index 7157386..892127d 100644 --- a/src/main/kotlin/moe/nea/ledger/ItemUtil.kt +++ b/src/main/kotlin/moe/nea/ledger/ItemUtil.kt @@ -19,3 +19,10 @@ fun ItemStack.getLore(): List { return (0 until lore.tagCount()).map { lore.getStringTagAt(it) } } + +fun ItemStack.getDisplayNameU(): String { + val nbt = this.tagCompound ?: NBTTagCompound() + val extraAttributes = nbt.getCompoundTag("display") + return extraAttributes.getString("Name") +} + -- cgit