Class MenuManager

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

public class MenuManager extends Object
Static manager class for Menus.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new menu manager instance if you somehow need one.
  • Method Summary

    Modifier and Type
    Method
    Description
    static MenuData
    getMenuData(org.bukkit.entity.Player player)
    Get someone's menu data outside the menus, so you can change some data.
    static void
    Open(org.bukkit.entity.Player p, Class<? extends Menu> menuClazz)
    Opens a menu for a Player.
    static void
    setPlugin(org.bukkit.plugin.java.JavaPlugin plugin)
    Set up the MenuManager by giving it a JavaPlugin.
    static void
    updateMenuData(org.bukkit.entity.Player player, MenuData newMenuData)
    Updates menu data of someone.

    Methods inherited from class java.lang.Object

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

    • MenuManager

      public MenuManager()
      Creates a new menu manager instance if you somehow need one.
  • Method Details

    • setPlugin

      public static void setPlugin(org.bukkit.plugin.java.JavaPlugin plugin)
      Set up the MenuManager by giving it a JavaPlugin.
      Parameters:
      plugin - Instance of your plugin.
    • getMenuData

      public static MenuData getMenuData(org.bukkit.entity.Player player)
      Get someone's menu data outside the menus, so you can change some data.
      Parameters:
      player - Player who you need to get menu data.
      Returns:
      MenuData stored for the Player given.
    • updateMenuData

      public static void updateMenuData(org.bukkit.entity.Player player, MenuData newMenuData) throws InvalidParameterException
      Updates menu data of someone. Recommended to use right before Open(Player, Class) if the data is changed from the code.
      Parameters:
      player - Player who has a different MenuData.
      newMenuData - new instance of MenuData to replace with old one.
      Throws:
      InvalidParameterException - If new MenuData's owner is not the Player given.
    • Open

      public static void Open(org.bukkit.entity.Player p, Class<? extends Menu> menuClazz)
      Opens a menu for a Player.
      Parameters:
      p - Player that will see this menu.
      menuClazz - Class reference of your Menu.