Interface Icon

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Icon
Represents the icon of a button.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Icon
    Adds the enchantment glint to this icon.
    default Icon
    Adds a line to the lore of this icon.
    default Icon
    applyToMeta(Consumer<org.bukkit.inventory.meta.ItemMeta> consumer)
    Applies the consumer to the meta of this icon.
    static Icon
    Creates an empty icon.
    org.bukkit.inventory.ItemStack
    get()
    Gets the item stack of this icon.
    default Icon
    Hides all attributes of this icon.
    default Icon
    Hides the attributes of this icon.
    default Icon
    Hides potion effects of this icon.
    static Icon
    of(Supplier<Icon> iconSupplier)
    Creates a dynamic icon from the given icon supplier.
    static Icon
    of(org.bukkit.inventory.ItemStack item)
    Creates an icon from the given item stack.
    static Icon
    of(org.bukkit.Material material)
    Creates an icon from the given material.
    default Icon
    runIf(boolean condition, Consumer<Icon> consumer)
    Runs the consumer if the condition is true.
    default Icon
    setLore(String... lore)
    Sets the lore of this icon.
    default Icon
    Sets the lore of this icon.
    default Icon
    setMaterial(org.bukkit.Material material)
    Sets the material of this icon.
    default Icon
    Sets the name of this icon.
  • Method Details

    • get

      org.bukkit.inventory.ItemStack get()
      Gets the item stack of this icon.
      Returns:
      the item stack
    • setName

      default Icon setName(@Colorized String name)
      Sets the name of this icon.
      Parameters:
      name - the name
      Returns:
      this icon
    • setMaterial

      default Icon setMaterial(org.bukkit.Material material)
      Sets the material of this icon.
      Parameters:
      material - the material
      Returns:
      this icon
    • hideAttributes

      default Icon hideAttributes()
      Hides the attributes of this icon.
      Returns:
      this icon
    • hidePotionEffects

      default Icon hidePotionEffects()
      Hides potion effects of this icon.
      Returns:
      this icon
    • hideAllAttributes

      default Icon hideAllAttributes()
      Hides all attributes of this icon.
      Returns:
      this icon
    • addEnchantmentGlint

      default Icon addEnchantmentGlint()
      Adds the enchantment glint to this icon.
      Returns:
      this icon
    • setLore

      default Icon setLore(@Colorized String... lore)
      Sets the lore of this icon.
      Parameters:
      lore - the lore
      Returns:
      this icon
    • setLore

      default Icon setLore(@Colorized List<String> lore)
      Sets the lore of this icon.
      Parameters:
      lore - the lore
      Returns:
      this icon
    • addLoreLine

      default Icon addLoreLine(@Colorized String line)
      Adds a line to the lore of this icon.
      Parameters:
      line - the line
      Returns:
      this icon
    • applyToMeta

      default Icon applyToMeta(Consumer<org.bukkit.inventory.meta.ItemMeta> consumer)
      Applies the consumer to the meta of this icon.
      Parameters:
      consumer - the consumer
      Returns:
      this icon
    • runIf

      default Icon runIf(boolean condition, Consumer<Icon> consumer)
      Runs the consumer if the condition is true.
      Parameters:
      condition - the condition
      consumer - the consumer
      Returns:
      this icon
    • empty

      static Icon empty()
      Creates an empty icon.
      Returns:
      the icon
    • of

      static Icon of(org.bukkit.inventory.ItemStack item)
      Creates an icon from the given item stack.
      Parameters:
      item - the item stack
      Returns:
      the icon
    • of

      static Icon of(org.bukkit.Material material)
      Creates an icon from the given material.
      Parameters:
      material - the material
      Returns:
      the icon
    • of

      static Icon of(Supplier<Icon> iconSupplier)
      Creates a dynamic icon from the given icon supplier.
      Parameters:
      iconSupplier - the icon supplier
      Returns:
      the icon