aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-09-09 15:24:39 +0200
committerGitHub <noreply@github.com>2024-09-09 15:24:39 +0200
commite17e70b6933982ca417577f441928f77cbbf9ef1 (patch)
tree2602f9ac1cdb041f33cdff880a457c54878fd01f /src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
parent2b4011efc9ef79fc478b44bce4959dc37424138a (diff)
downloadskyhanni-e17e70b6933982ca417577f441928f77cbbf9ef1.tar.gz
skyhanni-e17e70b6933982ca417577f441928f77cbbf9ef1.tar.bz2
skyhanni-e17e70b6933982ca417577f441928f77cbbf9ef1.zip
Feature: Current Minister in Calendar (#2342)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 774638c5d..168a12d95 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -55,6 +55,19 @@ object ItemUtils {
return list
}
+ fun ItemStack.setLore(lore: List<String>): ItemStack {
+ val tagCompound = this.tagCompound ?: NBTTagCompound()
+ val display = tagCompound.getCompoundTag("display")
+ val tagList = NBTTagList()
+ for (line in lore) {
+ tagList.appendTag(NBTTagString(line))
+ }
+ display.setTag("Lore", tagList)
+ tagCompound.setTag("display", display)
+ this.tagCompound = tagCompound
+ return this
+ }
+
var ItemStack.extraAttributes: NBTTagCompound
get() = this.tagCompound?.getCompoundTag("ExtraAttributes") ?: NBTTagCompound()
set(value) {