Interface Item

All Known Implementing Classes:
AsyncItem, AutoCycleItem, AutoUpdateItem, BaseItem, 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(Window window)
      Adds a Window to the window set, telling the Item that it is currently being displayed in that Window.
      Parameters:
      window - The Window the Item is currently displayed in.
    • removeWindow

      void removeWindow(Window window)
      Removes an Window from the window set, telling the Item that it is no longer being displayed in that Window.
      Parameters:
      window - The Window 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 the Window.handleItemProviderUpdate(Item) method on every Window in the set, notifying them that the ItemProvider has been updated and 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 the ItemStack associated to this Item has been clicked by a player.
      Parameters:
      clickType - The ClickType the Player did.
      player - The Player who clicked on the ItemStack
      event - The InventoryClickEvent associated with this click.