Class SingleWindow

java.lang.Object
de.studiocode.invui.window.impl.BaseWindow
de.studiocode.invui.window.impl.single.SingleWindow
All Implemented Interfaces:
GUIParent, Window
Direct Known Subclasses:
AnvilWindow, CartographyWindow, SimpleWindow

public abstract class SingleWindow extends BaseWindow
A Window that just uses the top Inventory.
  • Field Details

    • inventory

      protected org.bukkit.inventory.Inventory inventory
  • Constructor Details

    • SingleWindow

      public SingleWindow(UUID viewerUUID, net.md_5.bungee.api.chat.BaseComponent[] title, GUI gui, org.bukkit.inventory.Inventory inventory, boolean initItems, boolean closeable, boolean removeOnClose)
  • Method Details

    • initItems

      protected void initItems()
    • setInvItem

      protected void setInvItem(int slot, org.bukkit.inventory.ItemStack itemStack)
      Specified by:
      setInvItem in class BaseWindow
    • handleOpened

      protected void handleOpened()
      Specified by:
      handleOpened in class BaseWindow
    • handleClosed

      protected void handleClosed()
      Specified by:
      handleClosed in class BaseWindow
    • handleSlotElementUpdate

      public void handleSlotElementUpdate(GUI child, int slotIndex)
      Description copied from interface: GUIParent
      Called by the child GUI to report an update of a SlotElement.
      Parameters:
      child - The child GUI whose SlotElement has changed
      slotIndex - The slot index of the changed SlotElement in the child GUI
    • handleClick

      public void handleClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Description copied from interface: Window
      A method called by the WindowManager to notify the Window that one of its Items has been clicked.
      Parameters:
      event - The InventoryClickEvent associated with this action.
    • handleItemShift

      public void handleItemShift(org.bukkit.event.inventory.InventoryClickEvent event)
      Description copied from interface: Window
      A method called by the WindowManager to notify the Window that ItemStacks have been shift-clicked from the lower Inventory to this Window
      Parameters:
      event - The InventoryClickEvent associated with this action.
    • handleCursorCollect

      public void handleCursorCollect(org.bukkit.event.inventory.InventoryClickEvent event)
      Description copied from interface: Window
      A method called by the WindowManager to notify the Window that a Player is trying to collect ItemStack to the cursor by double-clicking in the player inventory. This method is not called when the player inventory is also part of the Window. (MergedWindow)
      Parameters:
      event - The InventoryClickEvent associated with this action.
    • getGuiAt

      protected Pair<GUI,Integer> getGuiAt(int index)
      Specified by:
      getGuiAt in class BaseWindow
    • getSlotElement

      protected SlotElement getSlotElement(int index)
      Specified by:
      getSlotElement in class BaseWindow
    • handleViewerDeath

      public void handleViewerDeath(org.bukkit.event.entity.PlayerDeathEvent event)
      Description copied from interface: Window
      A method called by the WindowManager to notify the Window that it's viewer has died.
      Parameters:
      event - The PlayerDeathEvent associated with this action.
    • getInventories

      public org.bukkit.inventory.Inventory[] getInventories()
      Description copied from interface: Window
      Gets the underlying Inventorys.
      Returns:
      The underlying Inventorys.
    • getGuis

      public GUI[] getGuis()
      Description copied from interface: Window
      Gets the underlying GUIs.
      Returns:
      The underlying GUIs.
    • getGui

      public GUI getGui()