From e17e70b6933982ca417577f441928f77cbbf9ef1 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:24:39 +0200 Subject: Feature: Current Minister in Calendar (#2342) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt') 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): 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) { -- cgit