Class MenuData

java.lang.Object
me.efekos.simpler.menu.MenuData

public class MenuData extends Object
Represents a temporary data for communication between any code and Menu classes.
  • Constructor Details

    • MenuData

      public MenuData(org.bukkit.entity.Player owner)
      Returns the Player who this data belongs to
      Parameters:
      owner - Final owner of this data.
  • Method Details

    • getMenuHistory

      public Stack<Menu> getMenuHistory()
      Returns a menu Stack used to store the history of menus owner visited.
      Returns:
      A history of the Menus visited by the owner.
    • get

      public Object get(String key)
      Gets a value from the stored data, using the key given.
      Parameters:
      key - Key to search for.
      Returns:
      Whatever found.
    • set

      public void set(String key, Object value)
      Sets a value for the key given.
      Parameters:
      key - Key to use.
      value - Value to enter.
    • getOwner

      public org.bukkit.entity.Player getOwner()
      Returns the Player who owns this data.
      Returns:
      Owner of this data.
    • addMenu

      public void addMenu(Menu menu)
      Adds a menu to the menu history of this data.
      Parameters:
      menu - Instance of the Menu.
    • lastMenu

      public Menu lastMenu()
      Removes the last menu from menu history and returns it.
      Returns:
      Last menu the owner visited.