Class WindowManager

java.lang.Object
xyz.xenondevs.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(AbstractWindow window)
      Adds an AbstractWindow to the list of windows. This method is usually called by the Window itself.
      Parameters:
      window - The AbstractWindow to add
    • removeWindow

      public void removeWindow(AbstractWindow window)
      Removes an AbstractWindow from the list of windows. This method is usually called by the Window itself.
      Parameters:
      window - The AbstractWindow 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 open Windows.
      Returns:
      A set of all Windows
    • getOpenWindows

      @Deprecated public Set<Window> getOpenWindows()
      Deprecated.
      Use getWindows() instead
      Gets a set of all open Windows.