Package xyz.xenondevs.invui.window
Class WindowManager
java.lang.Object
xyz.xenondevs.invui.window.WindowManager
- All Implemented Interfaces:
org.bukkit.event.Listener
Manages all
Windows and provides methods for searching them.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddWindow(AbstractWindow window) Adds anAbstractWindowto the list of windows.static WindowManagerGets theWindowManagerinstance or creates a new one if there isn't one.@Nullable WindowgetOpenWindow(org.bukkit.entity.Player player) Gets theWindowthePlayerhas currently open.Deprecated.@Nullable WindowgetWindow(org.bukkit.inventory.Inventory inventory) Finds theWindowto anInventory.Gets a set of all openWindows.voidremoveWindow(AbstractWindow window) Removes anAbstractWindowfrom the list of windows.
-
Method Details
-
getInstance
Gets theWindowManagerinstance or creates a new one if there isn't one.- Returns:
- The
WindowManagerinstance
-
addWindow
Adds anAbstractWindowto the list of windows. This method is usually called by theWindowitself.- Parameters:
window- TheAbstractWindowto add
-
removeWindow
Removes anAbstractWindowfrom the list of windows. This method is usually called by theWindowitself.- Parameters:
window- TheAbstractWindowto remove
-
getWindow
Finds theWindowto anInventory.- Parameters:
inventory- TheInventory- Returns:
- The
Windowthat belongs to thatInventory
-
getOpenWindow
Gets theWindowthePlayerhas currently open.- Parameters:
player- ThePlayer- Returns:
- The
WindowthePlayerhas currently open
-
getWindows
Gets a set of all openWindows.- Returns:
- A set of all
Windows
-
getOpenWindows
Deprecated.UsegetWindows()insteadGets a set of all openWindows.
-
getWindows()instead