Interface Item

All Known Implementing Classes:
AbstractItem, AsyncItem, AutoCycleItem, AutoUpdateItem, CommandItem, ControlItem, CycleItem, PageItem, ScrollItem, SimpleItem, SuppliedItem, TabItem

public interface Item
  • Method Details

    • getItemProvider

      ItemProvider getItemProvider()
      Gets the ItemProvider. This method gets called every time a Window is notified (notifyWindows()).
      Returns:
      The ItemProvider
    • addWindow

      void addWindow(AbstractWindow window)
      Adds an AbstractWindow to the window set, telling the Item that it is currently being displayed in that AbstractWindow.
      Parameters:
      window - The AbstractWindow the Item is currently displayed in.
    • removeWindow

      void removeWindow(AbstractWindow window)
      Removes an AbstractWindow from the window set, telling the Item that it is no longer being displayed in that AbstractWindow.
      Parameters:
      window - The AbstractWindow the Item is no longer displayed in.
    • getWindows

      Set<Window> getWindows()
      Gets an immutable Set of all the Windows where this Item is displayed in.
      Returns:
      An immutable view of the Set of all the Windows where this Item is displayed in.
    • notifyWindows

      void notifyWindows()
      Calls a refresh method on every Window in which this Item is displayed, notifying them that the ItemProvider has been updated, thus the ItemStack inside the Window's Inventory should be replaced.
    • handleClick

      void handleClick(@NotNull @NotNull org.bukkit.event.inventory.ClickType clickType, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent event)
      A method called if the ItemStack associated to this Item has been clicked by a player.
      Parameters:
      clickType - The ClickType the Player performed.
      player - The Player who clicked on the ItemStack.
      event - The InventoryClickEvent associated with this click.