Class Menu

  • Direct Known Subclasses:
    StandardMenu

    public abstract class Menu
    extends Object
    The menu
    • Constructor Detail

      • Menu

        protected Menu​(Config config)
        Create a new menu
        Parameters:
        config - the config
    • Method Detail

      • getName

        public String getName()
        Get the name
        Returns:
        the name
      • getConfig

        public Config getConfig()
        Get the config
        Returns:
        the config
      • getVariableManager

        public VariableManager getVariableManager()
        Get the variable manager
        Returns:
        the variable manager
      • create

        public abstract boolean create​(org.bukkit.entity.Player player,
                                       String[] args,
                                       boolean bypass)
        Called when opening the menu for the player
        Parameters:
        player - the player involved in
        args - the arguments from the open command
        bypass - whether the plugin ignores the permission check
        Returns:
        Whether it's successful
      • tabComplete

        public List<String> tabComplete​(org.bukkit.entity.Player player,
                                        String[] args)
        Called when the player hit TAB when typing the command to open the menu
        Parameters:
        player - the player involved in
        args - the arguments from the open command
        Returns:
        the list of suggestions
      • update

        public abstract void update​(org.bukkit.entity.Player player)
        Called when updating the menu
        Parameters:
        player - the player involved in
      • close

        public abstract void close​(org.bukkit.entity.Player player)
        Close the menu
        Parameters:
        player - the player involved in
      • closeAll

        public abstract void closeAll()
        Close/Clear all inventories of the type
      • getParentMenu

        public Optional<Menu> getParentMenu​(UUID uuid)
        Get the former menu that opened this menu
        Parameters:
        uuid - the unique id
        Returns:
        the former menu
      • setParentMenu

        public void setParentMenu​(UUID uuid,
                                  Menu menu)
        Set the former menu
        Parameters:
        uuid - the unique id
        menu - the former menu