diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-18 13:25:38 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-04-18 13:25:38 +0200 |
commit | c405a779bb12dd8e07d85623ce5e1e2ad903afe1 (patch) | |
tree | 1ed2f5ff65dbe996c58f57e64ee99c4216714246 /src/main/kotlin/moe/nea/ledger/ItemUtil.kt | |
parent | e1e67eb83e2ae35e770fb0612a4b99dd29f869da (diff) | |
download | LocalTransactionLedger-c405a779bb12dd8e07d85623ce5e1e2ad903afe1.tar.gz LocalTransactionLedger-c405a779bb12dd8e07d85623ce5e1e2ad903afe1.tar.bz2 LocalTransactionLedger-c405a779bb12dd8e07d85623ce5e1e2ad903afe1.zip |
Add dungeon chest opening event
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/ItemUtil.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/ItemUtil.kt | 7 |
1 files changed, 7 insertions, 0 deletions
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<String> { 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") +} + |