Class GUISession

java.lang.Object
com.bencodez.advancedcore.api.inventory.GUISession
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public class GUISession extends Object implements org.bukkit.inventory.InventoryHolder
Session holder for managing GUI state across inventory interactions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GUISession(BInventory inventoryGUI, int page)
    Construct a new GUISession
  • Method Summary

    Modifier and Type
    Method
    Description
    static GUISession
    extractSession(org.bukkit.entity.Player player)
    Extract the GUISession from the inventory currently being viewed by a player, or null if none exists
    static GUISession
    extractSession(org.bukkit.inventory.Inventory inventory)
    Get the GUISession for a given inventory, or null if none exists for this inventory
    org.bukkit.inventory.Inventory
    Method inherited from Bukkit's InventoryHolder.
    Get the InventoryGUI being viewed
    int
    Get the page currently being viewed
    void
    setPage(int page)
    Set the page currently being viewed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GUISession

      public GUISession(BInventory inventoryGUI, int page)
      Construct a new GUISession
      Parameters:
      inventoryGUI - The inventory that this a session to view
      page - The page currently being viewed
  • Method Details

    • extractSession

      public static GUISession extractSession(org.bukkit.inventory.Inventory inventory)
      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
    • extractSession

      public static GUISession extractSession(org.bukkit.entity.Player player)
      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
    • getInventory

      public org.bukkit.inventory.Inventory getInventory()
      Method inherited from Bukkit's InventoryHolder. Will always return null
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
      Returns:
      Null
    • getInventoryGUI

      public BInventory 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