All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.parzivalExe.guiApi.components.SettingOption.kt Maven / Gradle / Ivy

Go to download

With GuiAPI you can create Guis for your Bukkit/Spigot-Plugin in seconds while at the same time saving many lines of code

The newest version!
package io.github.parzivalExe.guiApi.components

import io.github.parzivalExe.guiApi.antlr.converter.ItemStackConverter
import io.github.parzivalExe.guiApi.antlr.interfaces.XMLAttribute
import io.github.parzivalExe.guiApi.antlr.interfaces.XMLConstructor
import org.bukkit.Material
import org.bukkit.inventory.ItemStack


class SettingOption(@XMLConstructor([
    XMLAttribute(true, "title", ""),
    XMLAttribute(true, "look", "166", ItemStackConverter::class),
    XMLAttribute(attrName = "description")])
                    var meta: ComponentMeta) {

    @Suppress("unused")
    @Deprecated("DON'T USE: This Constructor is only used for XML and shouldn't be used in Code itself", ReplaceWith("new SettingOption(ComponentMeta)"))
    internal constructor(): this(ComponentMeta("", ItemStack(Material.BARRIER)))

    constructor(title: String, look: ItemStack): this(ComponentMeta(title, look))
    constructor(title: String, look: ItemStack, description: ArrayList): this(ComponentMeta(title, look, description))

    var title: String
        get() = meta.title
        set(value) {
            meta.title = value
        }
    var look: ItemStack
        get() = meta.buildItem()
        set(value) = meta.setLook(value)
    var description: ArrayList
        get() = meta.description
        set(value) {
            meta.description = value
        }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy