InvUI/invui-kotlin/src/main/kotlin/xyz/xenondevs/invui/ItemBuilders.kt

12 lines
454 B
Kotlin
Raw Normal View History

2023-01-28 11:32:16 +00:00
@file:Suppress("PackageDirectoryMismatch")
package xyz.xenondevs.invui.item.builder
2023-01-28 11:32:16 +00:00
import net.md_5.bungee.api.chat.BaseComponent
import xyz.xenondevs.inventoryaccess.component.BaseComponentWrapper
import xyz.xenondevs.invui.util.ComponentUtils
2023-01-28 11:32:16 +00:00
/**
* Sets the lore of the item stack.
*/
fun <T> AbstractItemBuilder<T>.setLore(lore: List<Array<BaseComponent>>): T = setLore(lore.map { BaseComponentWrapper(ComponentUtils.withoutPreFormatting(*it)) })