Skip to content

Commit

Permalink
Jvm Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xap3y committed Jul 3, 2024
1 parent ce1faa5 commit fdc90b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack
* Interface for buttons in a GUI
* @see ButtonListener
*/
@Suppress("INAPPLICABLE_JVM_NAME")
interface GuiButtonInterface {

fun getIcon(): Material
Expand All @@ -25,18 +26,24 @@ interface GuiButtonInterface {

fun setName(name: String): GuiButton

@JvmName("setLoreList")
fun setLore(newLore: List<String>): GuiButton

@JvmName("setLoreArgs")
fun setLore(vararg args: String): GuiButton

@JvmName("setLoreArray")
fun setLore(array: Array<String>): GuiButton

fun addLoreLine(line: String): GuiButton

@JvmName("addLoreList")
fun addLore(lines: List<String>): GuiButton

@JvmName("addLoreArgs")
fun addLore(vararg args: String): GuiButton

@JvmName("addLoreArray")
fun addLore(array: Array<String>): GuiButton

fun clearLore(): GuiButton
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/eu/xap3y/xagui/models/GuiButton.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.bukkit.inventory.ItemStack
/**
* Represents a button in a GUI
*/
@Suppress("INAPPLICABLE_JVM_NAME")
class GuiButton(private val item: ItemStack): GuiButtonInterface {

/**
Expand Down Expand Up @@ -92,6 +93,7 @@ class GuiButton(private val item: ItemStack): GuiButtonInterface {
* @param args The new lore
* @return The button with the new lore
*/
@JvmName("setLoreArgs")
override fun setLore(vararg args: String): GuiButton {
return setLore(*args)
}
Expand All @@ -101,6 +103,7 @@ class GuiButton(private val item: ItemStack): GuiButtonInterface {
* @param array The new lore
* @return The button with the new lore
*/
@JvmName("setLoreArray")
override fun setLore(array: Array<String>): GuiButton {
return setLore(array.toList())
}
Expand Down Expand Up @@ -139,6 +142,7 @@ class GuiButton(private val item: ItemStack): GuiButtonInterface {
* @param args The lore to add
* @return The button with the lore added
*/
@JvmName("addLoreArgs")
override fun addLore(vararg args: String): GuiButton {
return addLore(*args)
}
Expand All @@ -148,6 +152,7 @@ class GuiButton(private val item: ItemStack): GuiButtonInterface {
* @param array The lore to add
* @return The button with the lore added
*/
@JvmName("addLoreArray")
override fun addLore(array: Array<String>): GuiButton {
return addLore(array)
}
Expand Down

0 comments on commit fdc90b5

Please sign in to comment.