Class WindowManager

java.lang.Object
de.studiocode.invui.window.WindowManager
All Implemented Interfaces:
org.bukkit.event.Listener

public class WindowManager extends Object implements org.bukkit.event.Listener
Manages all Windows and provides methods for searching them.
  • Method Details

    • getInstance

      public static WindowManager getInstance()
      Gets the WindowManager instance or creates a new one if there isn't one.
      Returns:
      The WindowManager instance
    • addWindow

      public void addWindow(Window window)
      Adds a Window to the list of windows. This method is usually called by the Window itself.
      Parameters:
      window - The Window to add
    • removeWindow

      public void removeWindow(Window window)
      Removes a Window from the list of windows. This method is usually called by the Window itself.
      Parameters:
      window - The Window to remove
    • getWindow

      @Nullable public @Nullable Window getWindow(org.bukkit.inventory.Inventory inventory)
      Finds the Window to an Inventory.
      Parameters:
      inventory - The Inventory
      Returns:
      The Window that belongs to that Inventory
    • getOpenWindow

      @Nullable public @Nullable Window getOpenWindow(org.bukkit.entity.Player player)
      Gets the Window the Player has currently open.
      Parameters:
      player - The Player
      Returns:
      The Window the Player has currently open
    • getWindows

      public Set<Window> getWindows()
      Gets a set of all registered Windows.
      Returns:
      A set of all Windows
    • getOpenWindows

      public Set<Window> getOpenWindows()
      Gets a set of all currently opened Windows.
      Returns:
      A set of all opened Windows