Class GUISession
java.lang.Object
me.eddie.inventoryguiapi.gui.session.GUISession
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
Represents a viewing session for a GUI.
-
Constructor Summary
ConstructorsConstructorDescriptionGUISession(InventoryGUI inventoryGUI, int page, GUIState guiState) Construct a new GUISession -
Method Summary
Modifier and TypeMethodDescriptionstatic GUISessionextractSession(org.bukkit.entity.Player player) Extract the GUISession from the inventory currently being viewed by a player, or null if none existsstatic GUISessionextractSession(org.bukkit.inventory.Inventory inventory) Get the GUISession for a given inventory, or null if none exists for this inventoryGet the state of the GUI currently being viewedorg.bukkit.inventory.InventoryMethod inherited from Bukkit's InventoryHolder.Get the InventoryGUI being viewedintgetPage()Get the page currently being viewedvoidsetPage(int page) Set the page currently being viewed
-
Constructor Details
-
GUISession
Construct a new GUISession- Parameters:
inventoryGUI- The inventory that this a session to viewpage- The page currently being viewedguiState- The state of the GUI being viewed
-
-
Method Details
-
extractSession
Extract the GUISession from the inventory currently being viewed by a player, or null if none exists- Parameters:
player- The player who's open inventory to extract the GUISession from- Returns:
- The GUISession or null if none exists
-
extractSession
Get the GUISession for a given inventory, or null if none exists for this inventory- Parameters:
inventory- The inventory to get the GUISession from- Returns:
- The GUISession or null if none exists
-
getInventoryGUI
Get the InventoryGUI being viewed- Returns:
- The InventoryGUI being viewed
-
getPage
public int getPage()Get the page currently being viewed- Returns:
- The page
-
setPage
public void setPage(int page) Set the page currently being viewed- Parameters:
page- The page
-
getGUIState
Get the state of the GUI currently being viewed- Returns:
- The GUIState of the GUI currently being viewed
-
getInventory
public org.bukkit.inventory.Inventory getInventory()Method inherited from Bukkit's InventoryHolder. Will always return null- Specified by:
getInventoryin interfaceorg.bukkit.inventory.InventoryHolder- Returns:
- Null
-