Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 2f90f9f

Browse files
committed
feat(item-builder): add more ItemBuilder#setLore methods
1 parent f9896de commit 2f90f9f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

api/src/main/java/com/undefined/api/event/Event.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inline fun <reified T : Event> event(
2020
priority: EventPriority = EventPriority.NORMAL,
2121
ignoreCancelled: Boolean = false,
2222
crossinline callback: T.() -> Unit
23-
): UndefinedListener = UndefinedListener().apply{
23+
): UndefinedListener = UndefinedListener().apply {
2424
com.undefined.api.API.plugin.server.pluginManager.registerEvent(
2525
T::class.java,
2626
this,

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
}
1313

1414
apply(plugin = "maven-publish")
15-
val versionVar = "0.5.84"
15+
val versionVar = "0.5.85"
1616
val groupIdVar = "com.undefined"
1717
val artifactIdVar = "api"
1818

common/src/main/java/com/undefined/api/utils/item/ItemBuilder.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class ItemBuilder(private val material: Material) {
5151
return this
5252
}
5353

54+
fun setLore(lore: List<Component>): ItemBuilder {
55+
this.lore = lore.toMutableList()
56+
return this
57+
}
58+
5459
fun setLore(vararg lore: Component): ItemBuilder {
5560
this.lore = lore.toMutableList()
5661
return this
@@ -61,6 +66,11 @@ class ItemBuilder(private val material: Material) {
6166
return this
6267
}
6368

69+
fun setLore(vararg lore: String): ItemBuilder {
70+
this.lore = lore.map { it.miniMessage() }.toMutableList()
71+
return this
72+
}
73+
6474
fun addLore(vararg lore: Component): ItemBuilder {
6575
this.lore.addAll(lore.toList())
6676
return this

0 commit comments

Comments
 (0)